diff options
author | Aaron Barany | 2019-01-24 01:54:18 -0800 |
---|---|---|
committer | Aaron Barany | 2019-01-24 01:54:18 -0800 |
commit | 855a244a42ec2bcb9ed46d46e2bd18f783dc92cf (patch) | |
tree | 52c801ea94110075ae3c67fde3ca6f7bdb3440c0 | |
parent | 0d9646d4f22909be97256075914fb0c22906697f (diff) | |
download | aur-855a244a42ec2bcb9ed46d46e2bd18f783dc92cf.tar.gz |
Fixes for CMake integration.
No longer reset all configurations to "all" on CMake configuration failure
and usability fixes for CMake variable editor.
Also updated the occurrences fix to be what was submitted upstream on
master.
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 15 | ||||
-rw-r--r-- | qtcreator-cmake-edit-fix.patch | 34 | ||||
-rw-r--r-- | qtcreator-cmake-fail-target-fix.patch | 29 | ||||
-rw-r--r-- | qtcreator-occurrences-fix.patch | 131 |
5 files changed, 181 insertions, 36 deletions
@@ -1,7 +1,7 @@ pkgbase = qtcreator-fixed-themes pkgdesc = Lightweight, cross-platform integrated development environment, with fixes applied for various themes and other bug fixes pkgver = 4.8.1 - pkgrel = 1 + pkgrel = 2 url = http://qt-project.org arch = x86_64 license = LGPL @@ -33,11 +33,15 @@ pkgbase = qtcreator-fixed-themes source = qtcreator-theme-fixes.patch source = qtcreator-occurrences-fix.patch source = qtcreator-debugger-columns-fix.patch + source = qtcreator-cmake-fail-target-fix.patch + source = qtcreator-cmake-edit-fix.patch sha256sums = 8f691de9b30b99dd44e010525ba9bf3054142a1082dc5273c46c533b91c07bd9 sha256sums = 6f19fc9d83964a5460d224b3d44ce580553847960181fe0364e2ce26e1efd2e6 sha256sums = bf0f8e88d0fa628d24f59eaf1f359873926998dde442e3bcbd56afcdd6eec7fa - sha256sums = ba6a48156cc14935a0dea12e8282bdfb1936e0c67216c660eef41bd5b5a44d4b + sha256sums = 640c4c1607f9ee867e2445ad576697b9b0d3c9a64ae6589c1b99ea4f1d7e3481 sha256sums = cf378a8b591a10646ad89d101375d8b04844c76a83d6c9c960036ba6a3b122e3 + sha256sums = df22bfe38bf6dd54b64d9ec0e78873a43e570eb490faf2a247aae7fd44e3d05e + sha256sums = 5f002e93717d99a23ed94842567caa35f5cddfac317bddf29e7a677fb6db61a3 pkgname = qtcreator-fixed-themes @@ -12,7 +12,7 @@ pkgname=qtcreator-fixed-themes pkgver=4.8.1 _clangver=7.0.1 -pkgrel=1 +pkgrel=2 pkgdesc='Lightweight, cross-platform integrated development environment, with fixes applied for various themes and other bug fixes' arch=(x86_64) url='http://qt-project.org' @@ -35,12 +35,16 @@ source=("http://download.qt.io/official_releases/qtcreator/${pkgver%.*}/$pkgver/ qtcreator-clang-plugins.patch qtcreator-theme-fixes.patch qtcreator-occurrences-fix.patch - qtcreator-debugger-columns-fix.patch) + qtcreator-debugger-columns-fix.patch + qtcreator-cmake-fail-target-fix.patch + qtcreator-cmake-edit-fix.patch) sha256sums=('8f691de9b30b99dd44e010525ba9bf3054142a1082dc5273c46c533b91c07bd9' '6f19fc9d83964a5460d224b3d44ce580553847960181fe0364e2ce26e1efd2e6' 'bf0f8e88d0fa628d24f59eaf1f359873926998dde442e3bcbd56afcdd6eec7fa' - 'ba6a48156cc14935a0dea12e8282bdfb1936e0c67216c660eef41bd5b5a44d4b' - 'cf378a8b591a10646ad89d101375d8b04844c76a83d6c9c960036ba6a3b122e3') + '640c4c1607f9ee867e2445ad576697b9b0d3c9a64ae6589c1b99ea4f1d7e3481' + 'cf378a8b591a10646ad89d101375d8b04844c76a83d6c9c960036ba6a3b122e3' + 'df22bfe38bf6dd54b64d9ec0e78873a43e570eb490faf2a247aae7fd44e3d05e' + '5f002e93717d99a23ed94842567caa35f5cddfac317bddf29e7a677fb6db61a3') prepare() { mkdir -p build @@ -59,6 +63,9 @@ prepare() { patch -p1 -i ../qtcreator-occurrences-fix.patch # Fix broken sizing for debugger columns. patch -p1 -i ../qtcreator-debugger-columns-fix.patch + # Fixes for CMake integration + patch -p1 -i ../qtcreator-cmake-fail-target-fix.patch + patch -p1 -i ../qtcreator-cmake-edit-fix.patch } build() { diff --git a/qtcreator-cmake-edit-fix.patch b/qtcreator-cmake-edit-fix.patch new file mode 100644 index 000000000000..40f59c80e28e --- /dev/null +++ b/qtcreator-cmake-edit-fix.patch @@ -0,0 +1,34 @@ +diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp +index 396bc00f68..5f0fad9260 100644 +--- a/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp ++++ b/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp +@@ -171,6 +171,12 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) + m_configTextFilterModel->setFilterKeyColumn(-1); + m_configTextFilterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); + ++ connect(m_configTextFilterModel, &QAbstractItemModel::layoutChanged, this, [this]() { ++ QModelIndex selectedIdx = m_configView->currentIndex(); ++ if (selectedIdx.isValid()) ++ m_configView->scrollTo(selectedIdx); ++ }); ++ + m_configView->setModel(m_configTextFilterModel); + m_configView->setMinimumHeight(300); + m_configView->setUniformRowHeights(true); +@@ -307,9 +313,13 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) + value = QString::fromLatin1("OFF"); + + m_configModel->appendConfiguration(tr("<UNSET>"), value, type); +- QModelIndex idx; +- idx = m_configView->model()->index( +- m_configView->model()->rowCount(idx) - 1, 0); ++ const Utils::TreeItem* item = m_configModel->findNonRootItem([&value, type](Utils::TreeItem* item) { ++ ConfigModel::DataItem dataItem = ConfigModel::dataItemFromIndex(item->index()); ++ return dataItem.key == tr("<UNSET>") && dataItem.type == type && dataItem.value == value; ++ }); ++ QModelIndex idx = m_configModel->indexForItem(item); ++ idx = m_configTextFilterModel->mapFromSource(m_configFilterModel->mapFromSource(idx)); ++ m_configView->scrollTo(idx); + m_configView->setCurrentIndex(idx); + m_configView->edit(idx); + }); diff --git a/qtcreator-cmake-fail-target-fix.patch b/qtcreator-cmake-fail-target-fix.patch new file mode 100644 index 000000000000..a768fb9033e0 --- /dev/null +++ b/qtcreator-cmake-fail-target-fix.patch @@ -0,0 +1,29 @@ +diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +index 21556ce0fd..f319af05d4 100644 +--- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp ++++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +@@ -115,8 +115,10 @@ CMakeRunConfiguration *CMakeBuildStep::targetsActiveRunConfiguration() const + return qobject_cast<CMakeRunConfiguration *>(target()->activeRunConfiguration()); + } + +-void CMakeBuildStep::handleBuildTargetChanges() ++void CMakeBuildStep::handleBuildTargetChanges(bool success) + { ++ if (!success) ++ return; // Do not change when parsing failed. + if (isCurrentExecutableTarget(m_buildTarget)) + return; // Do not change just because a different set of build targets is there... + if (!static_cast<CMakeProject *>(project())->buildTargetTitles().contains(m_buildTarget)) +diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h +index cfae9c9aab..91dab9b455 100644 +--- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h ++++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h +@@ -101,7 +101,7 @@ private: + void runImpl(QFutureInterface<bool> &fi); + void handleProjectWasParsed(QFutureInterface<bool> &fi, bool success); + +- void handleBuildTargetChanges(); ++ void handleBuildTargetChanges(bool success); + CMakeRunConfiguration *targetsActiveRunConfiguration() const; + + QMetaObject::Connection m_runTrigger; diff --git a/qtcreator-occurrences-fix.patch b/qtcreator-occurrences-fix.patch index c0838f581a90..d6af0d6f6d66 100644 --- a/qtcreator-occurrences-fix.patch +++ b/qtcreator-occurrences-fix.patch @@ -1,33 +1,104 @@ -diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.cpp b/src/plugins/cppeditor/cppuseselectionsupdater.cpp -index fc6123b94b..d78b33f17e 100644 ---- a/src/plugins/cppeditor/cppuseselectionsupdater.cpp -+++ b/src/plugins/cppeditor/cppuseselectionsupdater.cpp -@@ -168,6 +168,12 @@ CppUseSelectionsUpdater::toExtraSelections(const CursorInfo::Ranges &ranges, - TextEditor::TextStyle style) - { - CppUseSelectionsUpdater::ExtraSelections selections; -+ -+ // Skip if unset -+ const TextEditor::Format &format = m_editorWidget->textDocument()->fontSettings().formatFor(style); -+ if (!format.background().isValid()) -+ return selections; +diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp +index bc8d8c4d1a..a7203e8973 100644 +--- a/src/plugins/texteditor/fontsettings.cpp ++++ b/src/plugins/texteditor/fontsettings.cpp +@@ -143,6 +143,14 @@ uint qHash(const TextStyle &textStyle) + return ::qHash(quint8(textStyle)); + } + ++static bool isOverlayCategory(TextStyle category) ++{ ++ return category == C_OCCURRENCES ++ || category == C_OCCURRENCES_RENAME ++ || category == C_SEARCH_RESULT ++ || category == C_PARENTHESES_MISMATCH; ++} + - selections.reserve(ranges.size()); - - for (const CursorInfo::Range &range : ranges) { -diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp -index bb9c70f768..74ec2c58e1 100644 ---- a/src/plugins/qmljseditor/qmljseditor.cpp -+++ b/src/plugins/qmljseditor/qmljseditor.cpp -@@ -338,6 +338,11 @@ void QmlJSEditorWidget::updateUses() - if (m_qmlJsEditorDocument->isSemanticInfoOutdated()) // will be updated when info is updated + /** + * Returns the QTextCharFormat of the given format category. + */ +@@ -166,18 +174,18 @@ QTextCharFormat FontSettings::toTextCharFormat(TextStyle category) const + "Unused variable")); + } + +- if (f.foreground().isValid() +- && category != C_OCCURRENCES +- && category != C_OCCURRENCES_RENAME +- && category != C_SEARCH_RESULT +- && category != C_PARENTHESES_MISMATCH) ++ if (f.foreground().isValid() && !isOverlayCategory(category)) + tf.setForeground(f.foreground()); +- if (f.background().isValid() && (category == C_TEXT || f.background() != m_scheme.formatFor(C_TEXT).background())) +- tf.setBackground(f.background()); +- +- // underline does not need to fill without having background color +- if (f.underlineStyle() != QTextCharFormat::NoUnderline && !f.background().isValid()) +- tf.setBackground(QBrush(Qt::BrushStyle::NoBrush)); ++ if (f.background().isValid()) { ++ if (category == C_TEXT || f.background() != m_scheme.formatFor(C_TEXT).background()) ++ tf.setBackground(f.background()); ++ } else if (isOverlayCategory(category)) { ++ // overlays without a background schouldn't get painted ++ tf.setBackground(QColor()); ++ } else if (f.underlineStyle() != QTextCharFormat::NoUnderline) { ++ // underline does not need to fill without having background color ++ tf.setBackground(Qt::BrushStyle::NoBrush); ++ } + + tf.setFontWeight(f.bold() ? QFont::Bold : QFont::Normal); + tf.setFontItalic(f.italic()); +diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp +index 60fe5cc99e..a33ca13810 100644 +--- a/src/plugins/texteditor/texteditoroverlay.cpp ++++ b/src/plugins/texteditor/texteditoroverlay.cpp +@@ -323,9 +323,7 @@ void TextEditorOverlay::paintSelection(QPainter *painter, + const QColor &bg = selection.m_bg; + + +- if (begin.isNull() +- || end.isNull() +- || begin.position() > end.position()) ++ if (begin.isNull() || end.isNull() || begin.position() > end.position() || !bg.isValid()) return; -+ // Skip if unset -+ const Format &format = textDocument()->fontSettings().formatFor(C_OCCURRENCES); -+ if (!format.background().isValid()) -+ return; -+ - QList<QTextEdit::ExtraSelection> selections; - foreach (const AST::SourceLocation &loc, - m_qmlJsEditorDocument->semanticInfo().idLocations.value(wordUnderCursor())) { + QPainterPath path = createSelectionPath(begin, end, m_editor->viewport()->rect()); +@@ -339,25 +337,21 @@ void TextEditorOverlay::paintSelection(QPainter *painter, + + QRectF pathRect = path.controlPointRect(); + +- if (bg.isValid()) { +- if (!m_alpha || begin.blockNumber() != end.blockNumber()) { +- // gradients are too slow for larger selections :( +- QColor col = bg; +- if (m_alpha) +- col.setAlpha(50); +- painter->setBrush(col); +- } else { +- QLinearGradient linearGrad(pathRect.topLeft(), pathRect.bottomLeft()); +- QColor col1 = fg.lighter(150); +- col1.setAlpha(20); +- QColor col2 = fg; +- col2.setAlpha(80); +- linearGrad.setColorAt(0, col1); +- linearGrad.setColorAt(1, col2); +- painter->setBrush(QBrush(linearGrad)); +- } ++ if (!m_alpha || begin.blockNumber() != end.blockNumber()) { ++ // gradients are too slow for larger selections :( ++ QColor col = bg; ++ if (m_alpha) ++ col.setAlpha(50); ++ painter->setBrush(col); + } else { +- painter->setBrush(QBrush()); ++ QLinearGradient linearGrad(pathRect.topLeft(), pathRect.bottomLeft()); ++ QColor col1 = fg.lighter(150); ++ col1.setAlpha(20); ++ QColor col2 = fg; ++ col2.setAlpha(80); ++ linearGrad.setColorAt(0, col1); ++ linearGrad.setColorAt(1, col2); ++ painter->setBrush(QBrush(linearGrad)); + } + + painter->setRenderHint(QPainter::Antialiasing); |