kde-frameworks/ktexteditor: drop 5.92.0-r1

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2022-08-06 09:18:48 +02:00
parent 4f24d02ae8
commit 66330a02ca
4 changed files with 0 additions and 202 deletions
-1
View File
@@ -1,2 +1 @@
DIST ktexteditor-5.92.0.tar.xz 2347752 BLAKE2B c4e2356132f535dccbea1bae2355f3455b91d98c1cd99735db0ec39f0b2bc68f062e60e85f085e3614420d673487ea436243be485b321576022243736dec9f57 SHA512 5455fd579047db0010036afe0490620089687e206440ff77af270d9dcc25c1d48b3b8d763144f416cc539038c29e0e70703a1300b7ad78d0db59320a0712c402
DIST ktexteditor-5.96.0.tar.xz 2404504 BLAKE2B 3d35559a25a111b3a21ea48f8512b237f343fe31e4cce5031a60b6efd3eb1f832255ed327ec63c6d5e81bc2be2f7eac3eb524ef7b354516273f070a5057effa1 SHA512 83528972d06bdebbd5f00ff17b40bf6f413b29590127ab7ef2d842bf7bf248e18dfb9dfef4ad3501b2689fe14d6b0444ee654a06c4f58a0dc23bdebae2f7ea04
@@ -1,29 +0,0 @@
From ad82b876016367bd9765185dba84600985e5d0fd Mon Sep 17 00:00:00 2001
From: Waqar Ahmed <waqar.17a@gmail.com>
Date: Fri, 18 Mar 2022 10:14:28 +0500
Subject: [PATCH] Fix crash with stale indexes
BUG: 451593
---
src/completion/katecompletionmodel.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/completion/katecompletionmodel.cpp b/src/completion/katecompletionmodel.cpp
index 1e241f0d..d9bb8421 100644
--- a/src/completion/katecompletionmodel.cpp
+++ b/src/completion/katecompletionmodel.cpp
@@ -914,6 +914,11 @@ QModelIndex KateCompletionModel::mapToSource(const QModelIndex &proxyIndex) cons
}
if (Group *g = groupOfParent(proxyIndex)) {
+ if (!m_rowTable.contains(g)) {
+ qWarning() << Q_FUNC_INFO << "Stale proxy index for which there is no group";
+ return {};
+ }
+
if (proxyIndex.row() >= 0 && proxyIndex.row() < (int)g->filtered.size()) {
ModelRow source = g->filtered[proxyIndex.row()].sourceRow();
return source.second.sibling(source.second.row(), proxyIndex.column());
--
GitLab
@@ -1,112 +0,0 @@
From 1173d5184e8b073790556dbdba92a8b8abdd62dc Mon Sep 17 00:00:00 2001
From: Waqar Ahmed <waqar.17a@gmail.com>
Date: Mon, 14 Mar 2022 09:44:54 +0500
Subject: [PATCH] Fix toggle comment with space at the start
BUG: 451471
---
autotests/src/katedocument_test.cpp | 48 +++++++++++++++++++++++++++++
autotests/src/katedocument_test.h | 1 +
src/document/katedocument.cpp | 10 +++++-
3 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/autotests/src/katedocument_test.cpp b/autotests/src/katedocument_test.cpp
index f0946829..a842f960 100644
--- a/autotests/src/katedocument_test.cpp
+++ b/autotests/src/katedocument_test.cpp
@@ -851,4 +851,52 @@ void KateDocumentTest::testKeepUndoOverReload()
QCOMPARE(doc.text(), insertedText + initialText);
}
+void KateDocumentTest::testToggleComment()
+{
+ { // BUG: 451471
+ KTextEditor::DocumentPrivate doc;
+ QVERIFY(doc.highlightingModes().contains(QStringLiteral("Python")));
+ doc.setHighlightingMode(QStringLiteral("Python"));
+ const QString original = QStringLiteral("import hello;\n def method():");
+ doc.setText(original);
+ QVERIFY(doc.lines() == 2);
+
+ doc.commentSelection(doc.documentRange(), {1, 2}, false, 0); // 0 == ToggleComment
+ QCOMPARE(doc.text(), QStringLiteral("#import hello;\n #def method():"));
+
+ doc.commentSelection(doc.documentRange(), {1, 2}, false, 0); // 0 == ToggleComment
+ QCOMPARE(doc.text(), original);
+ }
+
+ { // Comment C++;
+ KTextEditor::DocumentPrivate doc;
+ QVERIFY(doc.highlightingModes().contains(QStringLiteral("C++")));
+ doc.setHighlightingMode(QStringLiteral("C++"));
+ QString original = QStringLiteral("#include<iostream>\nint main()\n{\nreturn 0;\n}\n");
+ doc.setText(original);
+ QVERIFY(doc.lines() == 6);
+
+ doc.commentSelection(doc.documentRange(), {5, 0}, false, 0); // 0 == ToggleComment
+ QCOMPARE(doc.text(), QStringLiteral("// #include<iostream>\n// int main()\n// {\n// return 0;\n// }\n"));
+
+ doc.commentSelection(doc.documentRange(), {5, 0}, false, 0); // 0 == ToggleComment
+ QCOMPARE(doc.text(), original);
+
+ // Comment just a portion
+ doc.commentSelection(Range(1, 0, 1, 3), Cursor(1, 3), false, 0);
+ QCOMPARE(doc.text(), QStringLiteral("#include<iostream>\n/*int*/ main()\n{\nreturn 0;\n}\n"));
+ doc.commentSelection(Range(1, 0, 1, 7), Cursor(1, 3), false, 0);
+ QCOMPARE(doc.text(), original);
+
+ // mixed, one line commented, one not => both get commented
+ original = QStringLiteral(" // int main()\n{}");
+ doc.setText(original);
+ doc.commentSelection(doc.documentRange(), {1, 2}, false, 0);
+ QCOMPARE(doc.text(), QStringLiteral("// // int main()\n// {}"));
+ doc.commentSelection(doc.documentRange(), {1, 2}, false, 0);
+ // after uncommenting, we get original text back with one line commented
+ QCOMPARE(doc.text(), original);
+ }
+}
+
#include "katedocument_test.moc"
diff --git a/autotests/src/katedocument_test.h b/autotests/src/katedocument_test.h
index c3b24b4c..0076f879 100644
--- a/autotests/src/katedocument_test.h
+++ b/autotests/src/katedocument_test.h
@@ -46,6 +46,7 @@ private Q_SLOTS:
void testIndentOnPaste();
void testAboutToSave();
void testKeepUndoOverReload();
+ void testToggleComment();
};
#endif // KATE_DOCUMENT_TEST_H
diff --git a/src/document/katedocument.cpp b/src/document/katedocument.cpp
index 56e8fc7d..b72592b6 100644
--- a/src/document/katedocument.cpp
+++ b/src/document/katedocument.cpp
@@ -3995,7 +3995,11 @@ bool KTextEditor::DocumentPrivate::removeStartLineCommentFromSelection(KTextEdit
bool allLinesAreCommented = true;
for (int line = endLine; line >= startLine; line--) {
const auto ln = m_buffer->plainLine(line);
- if (!ln->startsWith(shortCommentMark) && !ln->startsWith(longCommentMark)) {
+ const QString &text = ln->text();
+ QStringView textView(text.data(), text.size());
+ // Must trim any spaces at the beginning
+ textView = textView.trimmed();
+ if (!textView.startsWith(shortCommentMark) && !textView.startsWith(longCommentMark)) {
allLinesAreCommented = false;
break;
}
@@ -4031,6 +4035,10 @@ void KTextEditor::DocumentPrivate::commentSelection(KTextEditor::Range selection
int startAttrib = 0;
Kate::TextLine ln = kateTextLine(line);
+ if (!ln) {
+ qWarning() << __FUNCTION__ << __LINE__ << "Unexpected null TextLine for " << line << " lineCount: " << lines();
+ return;
+ }
if (selectionCol < ln->length()) {
startAttrib = ln->attribute(selectionCol);
--
GitLab
@@ -1,60 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PVCUT=$(ver_cut 1-2)
QTMIN=5.15.2
VIRTUALX_REQUIRED="test"
inherit ecm kde.org
DESCRIPTION="Framework providing a full text editor component"
LICENSE="LGPL-2+"
KEYWORDS="amd64 ~arm arm64 ~ppc64 ~riscv x86"
IUSE="+editorconfig"
RESTRICT="test"
DEPEND="
>=dev-qt/qtdeclarative-${QTMIN}:5
>=dev-qt/qtgui-${QTMIN}:5
>=dev-qt/qtprintsupport-${QTMIN}:5
>=dev-qt/qtwidgets-${QTMIN}:5
>=dev-qt/qtxml-${QTMIN}:5
=kde-frameworks/karchive-${PVCUT}*:5
=kde-frameworks/kauth-${PVCUT}*:5
=kde-frameworks/kcodecs-${PVCUT}*:5
=kde-frameworks/kcompletion-${PVCUT}*:5
=kde-frameworks/kconfig-${PVCUT}*:5
=kde-frameworks/kconfigwidgets-${PVCUT}*:5
=kde-frameworks/kcoreaddons-${PVCUT}*:5
=kde-frameworks/kguiaddons-${PVCUT}*:5
=kde-frameworks/ki18n-${PVCUT}*:5
=kde-frameworks/kiconthemes-${PVCUT}*:5
=kde-frameworks/kio-${PVCUT}*:5
=kde-frameworks/kitemviews-${PVCUT}*:5
=kde-frameworks/kjobwidgets-${PVCUT}*:5
=kde-frameworks/kparts-${PVCUT}*:5
=kde-frameworks/ktextwidgets-${PVCUT}*:5
=kde-frameworks/kwidgetsaddons-${PVCUT}*:5
=kde-frameworks/kxmlgui-${PVCUT}*:5
=kde-frameworks/sonnet-${PVCUT}*:5
=kde-frameworks/syntax-highlighting-${PVCUT}*:5
editorconfig? ( app-text/editorconfig-core-c )
"
RDEPEND="${DEPEND}"
BDEPEND="test? ( >=kde-frameworks/kservice-${PVCUT}:5 )"
PATCHES=(
"${FILESDIR}/${P}-fix-crash-w-stale-indexes.patch" # KDE-bug 451593
"${FILESDIR}/${P}-fix-toggle-comment.patch" # KDE-bug 451471
)
src_configure() {
local mycmakeargs=(
$(cmake_use_find_package editorconfig EditorConfig)
)
ecm_src_configure
}