forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-util/kdevelop-pg-qt: Port away from deprecated QString::midRef
Upstream commit c210967f753b33db48dbf942c7b32e67363ca204 Required by >=dev-util/kdevelop-24.08. Signed-off-by: Andreas Sturmlechner <[email protected]>
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
dev-util/kdevelop-pg-qt/files/kdevelop-pg-qt-2.2.2-port-away-from-depr-QString_midRef.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
From c210967f753b33db48dbf942c7b32e67363ca204 Mon Sep 17 00:00:00 2001 | ||
From: "Friedrich W. H. Kossebau" <[email protected]> | ||
Date: Sun, 30 Oct 2022 11:56:59 +0100 | ||
Subject: [PATCH] Port away from deprecated QString::midRef | ||
|
||
GIT_SILENT | ||
--- | ||
kdev-pg/kdev-pg-debug-visitor-gen.cpp | 2 +- | ||
kdev-pg/kdev-pg-regexp.cpp | 6 +++--- | ||
2 files changed, 4 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/kdev-pg/kdev-pg-debug-visitor-gen.cpp b/kdev-pg/kdev-pg-debug-visitor-gen.cpp | ||
index 418d044..d4394f7 100644 | ||
--- a/kdev-pg/kdev-pg-debug-visitor-gen.cpp | ||
+++ b/kdev-pg/kdev-pg-debug-visitor-gen.cpp | ||
@@ -72,7 +72,7 @@ void GenerateDebugVisitor::operator()() | ||
out << " tokenString += QStringLiteral(\" ...\");" << endl; | ||
out << " tokenString += QStringLiteral(\"%1 more\").arg(end-begin-20);" << endl; | ||
out << " tokenString += QStringLiteral(\"... \");" << endl; | ||
- out << " tokenString += m_content.midRef(end-10, 10);" << endl; | ||
+ out << " tokenString += QStringView(m_content).mid(end-10, 10);" << endl; | ||
out << " }" << endl; | ||
out << " else {" << endl; | ||
out << " tokenString = m_content.mid(begin, end-begin+1);" << endl; | ||
diff --git a/kdev-pg/kdev-pg-regexp.cpp b/kdev-pg/kdev-pg-regexp.cpp | ||
index fda19f9..808018f 100644 | ||
--- a/kdev-pg/kdev-pg-regexp.cpp | ||
+++ b/kdev-pg/kdev-pg-regexp.cpp | ||
@@ -71,10 +71,10 @@ inline QString codeForDot(QString str) | ||
int npos = str.indexOf("\n\01!ASIgnore\"!!\n# ", pos); | ||
if(npos == -1) | ||
{ | ||
- out += str.midRef(pos); | ||
+ out += QStringView(str).mid(pos); | ||
break; | ||
} | ||
- out += str.midRef(pos, npos - pos); | ||
+ out += QStringView(str).mid(pos, npos - pos); | ||
int nlpos = str.indexOf('\n', npos + 17); | ||
int codeendpos = str.indexOf("\n\01!AS/Ignore\"!!\n", nlpos); | ||
if(nlpos == -1 || codeendpos == -1) | ||
@@ -82,7 +82,7 @@ inline QString codeForDot(QString str) | ||
out += "<junk>"; | ||
break; | ||
} | ||
- out += str.midRef(nlpos + 1, codeendpos - nlpos - 1); | ||
+ out += QStringView(str).mid(nlpos + 1, codeendpos - nlpos - 1); | ||
pos = codeendpos + 17; | ||
} | ||
return out.replace('\"', "\\\"").replace('\n', '\t').trimmed(); | ||
-- | ||
GitLab | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 1999-2024 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
ECM_TEST="true" | ||
inherit ecm kde.org | ||
|
||
DESCRIPTION="LL(1) parser generator used mainly by KDevelop language plugins" | ||
HOMEPAGE="https://www.kdevelop.org/" | ||
SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz" | ||
|
||
LICENSE="LGPL-2+ LGPL-2.1+" | ||
SLOT="5" | ||
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" | ||
|
||
BDEPEND=" | ||
app-alternatives/yacc | ||
app-alternatives/lex | ||
" | ||
|
||
PATCHES=( "${FILESDIR}/${P}-port-away-from-depr-QString_midRef.patch" ) |