summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Barany2018-12-08 14:05:05 -0800
committerAaron Barany2018-12-08 14:05:05 -0800
commitd4147b8764b1d068aa39e5ec69769dc5ac1b163e (patch)
tree7065e2d6f9e9c2be9543cf11cd80be39d262ab6c
parent1c1859b43f62d7411f85b2f4d83808f3eaf5b3ea (diff)
downloadaur-d4147b8764b1d068aa39e5ec69769dc5ac1b163e.tar.gz
Added patch to allow fully disabling occurrence highlighting.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD7
-rw-r--r--qtcreator-occurrences-fix.patch33
3 files changed, 40 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 97bd899c3ff0..d92e5dcf68fa 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -33,11 +33,13 @@ pkgbase = qtcreator-fixed-themes
source = qtcreator-dark-theme-fixes.patch
source = qtcreator-dark-and-flat-selection-fixes.patch
source = qtcreator-exit-debugger-fix.patch
+ source = qtcreator-occurrences-fix.patch
sha256sums = aec7b4595e17f5536eb2eef4331057f2d0fa4ba0a46f4968cc06959a1d589b43
sha256sums = 6f19fc9d83964a5460d224b3d44ce580553847960181fe0364e2ce26e1efd2e6
sha256sums = a7b87219de0ee3e18754749a057535c04357acc2478dcb3fca6bc4b1ba8a8178
sha256sums = 514d9ff2989b0c865ead40b62df79f46871cbc1840ca552c64947b2e6c7d7d18
sha256sums = f938a72cc79c9ed8de07da8af79b170f67448a74dbd3228dd3de7e4855ed633d
+ sha256sums = ba6a48156cc14935a0dea12e8282bdfb1936e0c67216c660eef41bd5b5a44d4b
pkgname = qtcreator-fixed-themes
diff --git a/PKGBUILD b/PKGBUILD
index 26ca873500a7..2853d5fb24b8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -35,12 +35,14 @@ source=("http://download.qt.io/official_releases/qtcreator/${pkgver%.*}/$pkgver/
qtcreator-clang-plugins.patch
qtcreator-dark-theme-fixes.patch
qtcreator-dark-and-flat-selection-fixes.patch
- qtcreator-exit-debugger-fix.patch)
+ qtcreator-exit-debugger-fix.patch
+ qtcreator-occurrences-fix.patch)
sha256sums=('aec7b4595e17f5536eb2eef4331057f2d0fa4ba0a46f4968cc06959a1d589b43'
'6f19fc9d83964a5460d224b3d44ce580553847960181fe0364e2ce26e1efd2e6'
'a7b87219de0ee3e18754749a057535c04357acc2478dcb3fca6bc4b1ba8a8178'
'514d9ff2989b0c865ead40b62df79f46871cbc1840ca552c64947b2e6c7d7d18'
- 'f938a72cc79c9ed8de07da8af79b170f67448a74dbd3228dd3de7e4855ed633d')
+ 'f938a72cc79c9ed8de07da8af79b170f67448a74dbd3228dd3de7e4855ed633d'
+ 'ba6a48156cc14935a0dea12e8282bdfb1936e0c67216c660eef41bd5b5a44d4b')
prepare() {
mkdir -p build
@@ -57,6 +59,7 @@ prepare() {
# Theme fixes
patch -p1 -i ../qtcreator-dark-theme-fixes.patch
patch -p1 -i ../qtcreator-dark-and-flat-selection-fixes.patch
+ patch -p1 -i ../qtcreator-occurrences-fix.patch
# Bonus patch! Fix exiting debugger on program exit.
patch -p1 -i ../qtcreator-exit-debugger-fix.patch
}
diff --git a/qtcreator-occurrences-fix.patch b/qtcreator-occurrences-fix.patch
new file mode 100644
index 000000000000..c0838f581a90
--- /dev/null
+++ b/qtcreator-occurrences-fix.patch
@@ -0,0 +1,33 @@
+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;
++
+ 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
+ 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())) {