Skip to content

Commit

Permalink
dev-util/kdevelop-pg-qt: Port away from deprecated QString::midRef
Browse files Browse the repository at this point in the history
Upstream commit c210967f753b33db48dbf942c7b32e67363ca204

Required by >=dev-util/kdevelop-24.08.

Signed-off-by: Andreas Sturmlechner <[email protected]>
  • Loading branch information
a17r committed Jul 21, 2024
1 parent 4899e6a commit c7a6125
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
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

22 changes: 22 additions & 0 deletions dev-util/kdevelop-pg-qt/kdevelop-pg-qt-2.2.2-r1.ebuild
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" )

0 comments on commit c7a6125

Please sign in to comment.