From 770b2f1bc6bbc01ea72c3920accc262bd8ec81ce Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 4 Feb 2020 16:59:55 +0100 Subject: [PATCH 1/3] Doc: Fix PreprosessorClient docs Fix values of \fn commands and document attributes. Change-Id: Id09eb30e861289e9d982d7e0f914c68114ecf50c Reviewed-by: hjk --- src/libs/cplusplus/PreprocessorClient.cpp | 36 +++++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/libs/cplusplus/PreprocessorClient.cpp b/src/libs/cplusplus/PreprocessorClient.cpp index 68be342821b..9705cf40977 100644 --- a/src/libs/cplusplus/PreprocessorClient.cpp +++ b/src/libs/cplusplus/PreprocessorClient.cpp @@ -36,34 +36,44 @@ using namespace CPlusPlus; /*! \fn void Client::macroAdded(const Macro ¯o) - Called whenever a new macro is defined. + Called whenever a new \a macro is defined. */ /*! - \fn void Client::passedMacroDefinitionCheck(int offset, int line, const Macro ¯o) + \fn void Client::passedMacroDefinitionCheck(int bytesOffset, + int utf16charsOffset, + int line, + const Macro ¯o) - Called when the preprocessor checks whether a macro is defined or not and the - result is positive. + Called when the preprocessor checks whether \a macro at \a line with + \a bytesOffset and \a utf16charsOffset is defined and the result is + positive. \sa failedMacroDefinitionCheck() */ /*! - \fn void Client::failedMacroDefinitionCheck(int offset, const ByteArrayRef &name) + \fn void Client::failedMacroDefinitionCheck(int bytesOffset, + int utf16charsOffset, + const ByteArrayRef &name) - Called when the preprocessor checks whether a macro is defined or not and the - result is negative. + Called when the preprocessor checks whether the macro specified by \a name + is defined with \a bytesOffset and \a utf16charsOffset and the result is + negative. \sa passedMacroDefinitionCheck() */ /*! - \fn void Client::startExpandingMacro(int offset, - int line, - const Macro ¯o, - const QVector &actuals - = QVector()) - Called when starting to expand a macro. + \fn void Client::startExpandingMacro(int bytesOffset, + int utf16charsOffset, + int line, + const Macro ¯o, + const QVector &actuals + = QVector()) + + Called when starting to expand \a macro at \a line with \a bytesOffset, + \a utf16charsOffset, and \a actuals. \sa stopExpandingMacro() */ From c522ceb7dd678df063db930288c9d269ee464e13 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 10 Feb 2020 12:22:01 +0100 Subject: [PATCH 2/3] macOS: Do really deep deep code signing for notarization Notarization is more picky than the regular code signing. All code outside of the "usual" binary directories must be signed separately, in addition to being codesigned with the application afterwards. That includes Imports/qtquick2 and Resources/libexec. We cannot just move these into e.g. MacOS/ or PlugIns/ either, because these directories may _only_ contain code, no other resources. Change-Id: Id05b2644e01b61e9c33d86617c6374225b50e7f3 Reviewed-by: Eike Ziller --- scripts/common.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/common.py b/scripts/common.py index 10287ce6935..7c2fb13271d 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -181,10 +181,25 @@ def is_not_debug(path, filenames): def codesign(app_path): signing_identity = os.environ.get('SIGNING_IDENTITY') if is_mac_platform() and signing_identity: - codesign_call = ['codesign', '-o', 'runtime', '--force', '--deep', '-s', signing_identity, + codesign_call = ['codesign', '-o', 'runtime', '--force', '-s', signing_identity, '-v'] signing_flags = os.environ.get('SIGNING_FLAGS') if signing_flags: codesign_call.extend(signing_flags.split()) - codesign_call.append(app_path) - subprocess.check_call(codesign_call) + + def conditional_sign_recursive(path, filter): + for r, _, fs in os.walk(path): + for f in fs: + ff = os.path.join(r, f) + if filter(ff): + print('codesign "' + ff + '"') + subprocess.check_call(codesign_call + [ff]) + + # sign all executables in Resources + conditional_sign_recursive(os.path.join(app_path, 'Contents', 'Resources'), + lambda ff: os.access(ff, os.X_OK)) + # sign all libraries in Imports + conditional_sign_recursive(os.path.join(app_path, 'Contents', 'Imports'), + lambda ff: ff.endswith('.dylib')) + # sign the whole bundle + subprocess.check_call(codesign_call + ['--deep', app_path]) From e85d6b363bd039c4407bbf5367cce0efdd559945 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 28 Nov 2019 13:03:32 +0100 Subject: [PATCH 3/3] Editor: Improve splitting format range performance Instead of copying the list and move some items individualy from one list to the other use Utils::partition. Fixes: QTCREATORBUG-23281 Change-Id: Iaf9430c041aa916feecf9214303ba30f17290ba8 Reviewed-by: Eike Ziller --- src/plugins/texteditor/syntaxhighlighter.cpp | 50 ++++++++------------ 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp index b28ac1ee183..bfa0f85a866 100644 --- a/src/plugins/texteditor/syntaxhighlighter.cpp +++ b/src/plugins/texteditor/syntaxhighlighter.cpp @@ -78,13 +78,13 @@ public: bool noAutomaticHighlighting = false; }; -static bool adjustRange(QTextLayout::FormatRange &range, int from, int charsRemoved, int charsAdded) { - +static bool adjustRange(QTextLayout::FormatRange &range, int from, int charsDelta) +{ if (range.start >= from) { - range.start += charsAdded - charsRemoved; + range.start += charsDelta; return true; } else if (range.start + range.length > from) { - range.length += charsAdded - charsRemoved; + range.length += charsDelta; return true; } return false; @@ -105,32 +105,24 @@ void SyntaxHighlighterPrivate::applyFormatChanges(int from, int charsRemoved, in QTextLayout *layout = currentBlock.layout(); - QVector ranges = layout->formats(); + QVector ranges; + QVector oldRanges; + std::tie(ranges, oldRanges) + = Utils::partition(layout->formats(), [](const QTextLayout::FormatRange &range) { + return range.format.property(QTextFormat::UserProperty).toBool(); + }); - bool doAdjustRange = currentBlock.contains(from); - - QVector old_ranges; - - if (!ranges.isEmpty()) { - auto it = ranges.begin(); - while (it != ranges.end()) { - if (it->format.property(QTextFormat::UserProperty).toBool()) { - if (doAdjustRange) - formatsChanged = adjustRange(*it, from - currentBlock.position(), charsRemoved, charsAdded) - || formatsChanged; - ++it; - } else { - old_ranges.append(*it); - it = ranges.erase(it); - } - } + if (currentBlock.contains(from)) { + const int charsDelta = charsAdded - charsRemoved; + for (QTextLayout::FormatRange &range : ranges) + formatsChanged |= adjustRange(range, from - currentBlock.position(), charsDelta); } QTextCharFormat emptyFormat; QTextLayout::FormatRange r; - QVector new_ranges; + QVector newRanges; int i = 0; while (i < formatChanges.count()) { @@ -148,19 +140,19 @@ void SyntaxHighlighterPrivate::applyFormatChanges(int from, int charsRemoved, in r.length = i - r.start; - new_ranges << r; + newRanges << r; } - formatsChanged = formatsChanged || (new_ranges.size() != old_ranges.size()); + formatsChanged = formatsChanged || (newRanges.size() != oldRanges.size()); - for (int i = 0; !formatsChanged && i < new_ranges.size(); ++i) { - const QTextLayout::FormatRange &o = old_ranges.at(i); - const QTextLayout::FormatRange &n = new_ranges.at(i); + for (int i = 0; !formatsChanged && i < newRanges.size(); ++i) { + const QTextLayout::FormatRange &o = oldRanges.at(i); + const QTextLayout::FormatRange &n = newRanges.at(i); formatsChanged = (o.start != n.start || o.length != n.length || o.format != n.format); } if (formatsChanged) { - ranges.append(new_ranges); + ranges.append(newRanges); layout->setFormats(ranges); doc->markContentsDirty(currentBlock.position(), currentBlock.length()); }