1 |
commit: 9271d41df8a7c2753171771f9b7947d635621e0f |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 16 22:35:21 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jul 17 00:06:29 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9271d41d |
7 |
|
8 |
kde-apps/kfind: Clean up defunct KRegExpEditorInterface code |
9 |
|
10 |
Incidentally drops an unused dependency we had not listed. |
11 |
|
12 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
13 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
14 |
|
15 |
.../kfind/files/kfind-21.04.3-unused-dep.patch | 272 +++++++++++++++++++++ |
16 |
kde-apps/kfind/kfind-21.04.3-r1.ebuild | 39 +++ |
17 |
2 files changed, 311 insertions(+) |
18 |
|
19 |
diff --git a/kde-apps/kfind/files/kfind-21.04.3-unused-dep.patch b/kde-apps/kfind/files/kfind-21.04.3-unused-dep.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..f348bf39b5d |
22 |
--- /dev/null |
23 |
+++ b/kde-apps/kfind/files/kfind-21.04.3-unused-dep.patch |
24 |
@@ -0,0 +1,272 @@ |
25 |
+From b23e8823d7c950b43259b8750f0d14c19fa5f31c Mon Sep 17 00:00:00 2001 |
26 |
+From: Alexander Lohnau <alexander.lohnau@×××.de> |
27 |
+Date: Sat, 22 May 2021 07:15:04 +0200 |
28 |
+Subject: [PATCH] Clean up defunct KRegExpEditorInterface code |
29 |
+ |
30 |
+This code is deprecated, defunct and partly commented out for years. |
31 |
+--- |
32 |
+ CMakeLists.txt | 1 - |
33 |
+ src/CMakeLists.txt | 1 - |
34 |
+ src/kftabdlg.cpp | 48 +--------------------------------------------- |
35 |
+ src/kftabdlg.h | 4 ---- |
36 |
+ src/kquery.cpp | 31 +++++++----------------------- |
37 |
+ src/kquery.h | 3 +-- |
38 |
+ 6 files changed, 9 insertions(+), 79 deletions(-) |
39 |
+ |
40 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
41 |
+index 4587dd278..1c867f5b5 100644 |
42 |
+--- a/CMakeLists.txt |
43 |
++++ b/CMakeLists.txt |
44 |
+@@ -38,7 +38,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS |
45 |
+ FileMetaData |
46 |
+ I18n |
47 |
+ KIO |
48 |
+- TextWidgets |
49 |
+ WidgetsAddons |
50 |
+ ) |
51 |
+ |
52 |
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt |
53 |
+index 97d81a963..d24b5f4b0 100644 |
54 |
+--- a/src/CMakeLists.txt |
55 |
++++ b/src/CMakeLists.txt |
56 |
+@@ -22,7 +22,6 @@ KF5::CoreAddons |
57 |
+ KF5::FileMetaData |
58 |
+ KF5::I18n |
59 |
+ KF5::KIOWidgets |
60 |
+-KF5::TextWidgets |
61 |
+ KF5::WidgetsAddons |
62 |
+ KF5::XmlGui |
63 |
+ ) |
64 |
+diff --git a/src/kftabdlg.cpp b/src/kftabdlg.cpp |
65 |
+index ddb9c7be0..f2c6cbf7a 100644 |
66 |
+--- a/src/kftabdlg.cpp |
67 |
++++ b/src/kftabdlg.cpp |
68 |
+@@ -29,8 +29,6 @@ |
69 |
+ #include <KLineEdit> |
70 |
+ #include <KLocalizedString> |
71 |
+ #include <KMessageBox> |
72 |
+-#include <KRegExpEditorInterface> |
73 |
+-#include <KServiceTypeTrader> |
74 |
+ #include <KSharedConfig> |
75 |
+ #include <KShell> |
76 |
+ #include <KUrlComboBox> |
77 |
+@@ -55,7 +53,6 @@ struct MimeTypes |
78 |
+ |
79 |
+ KfindTabWidget::KfindTabWidget(QWidget *parent) |
80 |
+ : QTabWidget(parent) |
81 |
+- , regExpDialog(nullptr) |
82 |
+ { |
83 |
+ // This validator will be used for all numeric edit fields |
84 |
+ //KDigitValidator *digitV = new KDigitValidator(this); |
85 |
+@@ -307,7 +304,6 @@ KfindTabWidget::KfindTabWidget(QWidget *parent) |
86 |
+ |
87 |
+ caseContextCb = new QCheckBox(i18n("Case s&ensitive"), pages[2]); |
88 |
+ binaryContextCb = new QCheckBox(i18n("Include &binary files"), pages[2]); |
89 |
+- regexpContentCb = new QCheckBox(i18n("Regular e&xpression"), pages[2]); |
90 |
+ |
91 |
+ const QString binaryTooltip |
92 |
+ = i18n("<qt>This lets you search in any type of file, " |
93 |
+@@ -315,13 +311,6 @@ KfindTabWidget::KfindTabWidget(QWidget *parent) |
94 |
+ "program files and images).</qt>"); |
95 |
+ binaryContextCb->setToolTip(binaryTooltip); |
96 |
+ |
97 |
+- QPushButton *editRegExp = nullptr; |
98 |
+- if (!KServiceTypeTrader::self()->query(QStringLiteral("KRegExpEditor/KRegExpEditor")).isEmpty()) { |
99 |
+- // The editor is available, so lets use it. |
100 |
+- editRegExp = new QPushButton(i18n("&Edit..."), pages[2]); |
101 |
+- editRegExp->setObjectName(QStringLiteral("editRegExp")); |
102 |
+- } |
103 |
+- |
104 |
+ metainfokeyEdit = new KLineEdit(pages[2]); |
105 |
+ metainfoEdit = new KLineEdit(pages[2]); |
106 |
+ QLabel *textMetaInfo = new QLabel(i18nc("as in search for", "fo&r:"), pages[2]); |
107 |
+@@ -387,15 +376,6 @@ KfindTabWidget::KfindTabWidget(QWidget *parent) |
108 |
+ watcher->deleteLater(); |
109 |
+ }); |
110 |
+ |
111 |
+- if (editRegExp) { |
112 |
+- // The editor was available, so lets use it. |
113 |
+- connect(regexpContentCb, &QCheckBox::toggled, editRegExp, &QPushButton::setEnabled); |
114 |
+- editRegExp->setEnabled(false); |
115 |
+- connect(editRegExp, &QPushButton::clicked, this, &KfindTabWidget::slotEditRegExp); |
116 |
+- } else { |
117 |
+- regexpContentCb->hide(); |
118 |
+- } |
119 |
+- |
120 |
+ // Layout |
121 |
+ tmp = sizeEdit->fontMetrics().boundingRect(QStringLiteral(" 00000 ")).width(); |
122 |
+ sizeEdit->setMinimumSize(tmp, sizeEdit->sizeHint().height()); |
123 |
+@@ -405,7 +385,6 @@ KfindTabWidget::KfindTabWidget(QWidget *parent) |
124 |
+ grid2->addWidget(textL, 1, 0); |
125 |
+ grid2->addWidget(typeBox, 0, 1, 1, 3); |
126 |
+ grid2->addWidget(textEdit, 1, 1, 1, 3); |
127 |
+- grid2->addWidget(regexpContentCb, 2, 2); |
128 |
+ grid2->addWidget(caseContextCb, 2, 1); |
129 |
+ grid2->addWidget(binaryContextCb, 3, 1); |
130 |
+ |
131 |
+@@ -416,11 +395,6 @@ KfindTabWidget::KfindTabWidget(QWidget *parent) |
132 |
+ |
133 |
+ metainfokeyEdit->setText(QStringLiteral("*")); |
134 |
+ |
135 |
+- if (editRegExp) { |
136 |
+- // The editor was available, so lets use it. |
137 |
+- grid2->addWidget(editRegExp, 2, 3); |
138 |
+- } |
139 |
+- |
140 |
+ addTab(pages[0], i18n("Name/&Location")); |
141 |
+ addTab(pages[2], i18nc("tab name: search by contents", "C&ontents")); |
142 |
+ addTab(pages[1], i18n("&Properties")); |
143 |
+@@ -532,25 +506,6 @@ void KfindTabWidget::loadHistory() |
144 |
+ } |
145 |
+ } |
146 |
+ |
147 |
+-void KfindTabWidget::slotEditRegExp() |
148 |
+-{ |
149 |
+-#if 0 |
150 |
+- if (!regExpDialog) { |
151 |
+- regExpDialog = KServiceTypeTrader::createInstanceFromQuery<QDialog>(QStringLiteral("KRegExpEditor/KRegExpEditor"), QString(), this); |
152 |
+- } |
153 |
+- |
154 |
+- KRegExpEditorInterface *iface = qobject_cast<KRegExpEditorInterface *>(regExpDialog); |
155 |
+- if (!iface) { |
156 |
+- return; |
157 |
+- } |
158 |
+- |
159 |
+- iface->setRegExp(textEdit->text()); |
160 |
+- if (regExpDialog->exec()) { |
161 |
+- textEdit->setText(iface->regExp()); |
162 |
+- } |
163 |
+-#endif |
164 |
+-} |
165 |
+- |
166 |
+ void KfindTabWidget::setFocus() |
167 |
+ { |
168 |
+ nameBox->setFocus(); |
169 |
+@@ -771,8 +726,7 @@ void KfindTabWidget::setQuery(KQuery *query) |
170 |
+ |
171 |
+ query->setShowHiddenFiles(hiddenFilesCb->isChecked()); |
172 |
+ |
173 |
+- query->setContext(textEdit->text(), caseContextCb->isChecked(), |
174 |
+- binaryContextCb->isChecked(), regexpContentCb->isChecked()); |
175 |
++ query->setContext(textEdit->text(), caseContextCb->isChecked(), binaryContextCb->isChecked()); |
176 |
+ } |
177 |
+ |
178 |
+ void KfindTabWidget::getDirectory() |
179 |
+diff --git a/src/kftabdlg.h b/src/kftabdlg.h |
180 |
+index e2a4912d6..336835a06 100644 |
181 |
+--- a/src/kftabdlg.h |
182 |
++++ b/src/kftabdlg.h |
183 |
+@@ -23,7 +23,6 @@ class QString; |
184 |
+ class QDate; |
185 |
+ class QRegExp; |
186 |
+ class KDateComboBox; |
187 |
+-class QDialog; |
188 |
+ class KComboBox; |
189 |
+ class QSpinBox; |
190 |
+ class QLabel; |
191 |
+@@ -60,7 +59,6 @@ private Q_SLOTS: |
192 |
+ void getDirectory(); |
193 |
+ void fixLayout(); |
194 |
+ void slotSizeBoxChanged(int); |
195 |
+- void slotEditRegExp(); |
196 |
+ |
197 |
+ Q_SIGNALS: |
198 |
+ void startSearch(); |
199 |
+@@ -112,8 +110,6 @@ private: |
200 |
+ QSpinBox *sizeEdit; |
201 |
+ QCheckBox *caseContextCb; |
202 |
+ QCheckBox *binaryContextCb; |
203 |
+- QCheckBox *regexpContentCb; |
204 |
+- QDialog *regExpDialog; |
205 |
+ |
206 |
+ QUrl m_url; |
207 |
+ |
208 |
+diff --git a/src/kquery.cpp b/src/kquery.cpp |
209 |
+index 91e45ed07..c6c7327bf 100644 |
210 |
+--- a/src/kquery.cpp |
211 |
++++ b/src/kquery.cpp |
212 |
+@@ -35,7 +35,6 @@ KQuery::KQuery(QObject *parent) |
213 |
+ , m_recursive(false) |
214 |
+ , m_casesensitive(false) |
215 |
+ , m_search_binary(false) |
216 |
+- , m_regexpForContent(false) |
217 |
+ , m_useLocate(false) |
218 |
+ , m_showHiddenFiles(false) |
219 |
+ , job(nullptr) |
220 |
+@@ -458,19 +457,11 @@ void KQuery::processQuery(const KFileItem &file) |
221 |
+ str.remove(xmlTags); |
222 |
+ } |
223 |
+ |
224 |
+- if (m_regexpForContent) { |
225 |
+- if (m_regexp.indexIn(str) >= 0) { |
226 |
+- matchingLine = QString::number(matchingLineNumber)+QStringLiteral(": ")+str.trimmed(); |
227 |
+- found = true; |
228 |
+- break; |
229 |
+- } |
230 |
+- } else { |
231 |
+- if (str.indexOf(m_context, 0, m_casesensitive ? Qt::CaseSensitive : Qt::CaseInsensitive) != -1) { |
232 |
+- matchingLine = QString::number(matchingLineNumber)+QStringLiteral(": ")+str.trimmed(); |
233 |
+- found = true; |
234 |
+- break; |
235 |
+- } |
236 |
+- } |
237 |
++ if (str.indexOf(m_context, 0, m_casesensitive ? Qt::CaseSensitive : Qt::CaseInsensitive) != -1) { |
238 |
++ matchingLine = QString::number(matchingLineNumber)+QStringLiteral(": ")+str.trimmed(); |
239 |
++ found = true; |
240 |
++ break; |
241 |
++ } |
242 |
+ qApp->processEvents(); |
243 |
+ } |
244 |
+ |
245 |
+@@ -484,25 +475,17 @@ void KQuery::processQuery(const KFileItem &file) |
246 |
+ m_foundFilesList.append(QPair<KFileItem, QString>(file, matchingLine)); |
247 |
+ } |
248 |
+ |
249 |
+-void KQuery::setContext(const QString &context, bool casesensitive, bool search_binary, bool useRegexp) |
250 |
++void KQuery::setContext(const QString &context, bool casesensitive, bool search_binary) |
251 |
+ { |
252 |
+ m_context = context; |
253 |
+ m_casesensitive = casesensitive; |
254 |
+ m_search_binary = search_binary; |
255 |
+- m_regexpForContent = useRegexp; |
256 |
+- if (!m_regexpForContent) { |
257 |
+- m_regexp.setPatternSyntax(QRegExp::Wildcard); |
258 |
+- } else { |
259 |
+- m_regexp.setPatternSyntax(QRegExp::RegExp); |
260 |
+- } |
261 |
++ m_regexp.setPatternSyntax(QRegExp::Wildcard); |
262 |
+ if (casesensitive) { |
263 |
+ m_regexp.setCaseSensitivity(Qt::CaseSensitive); |
264 |
+ } else { |
265 |
+ m_regexp.setCaseSensitivity(Qt::CaseInsensitive); |
266 |
+ } |
267 |
+- if (m_regexpForContent) { |
268 |
+- m_regexp.setPattern(m_context); |
269 |
+- } |
270 |
+ } |
271 |
+ |
272 |
+ void KQuery::setMetaInfo(const QString &metainfo, const QString &metainfokey) |
273 |
+diff --git a/src/kquery.h b/src/kquery.h |
274 |
+index 285b37214..2e581765c 100644 |
275 |
+--- a/src/kquery.h |
276 |
++++ b/src/kquery.h |
277 |
+@@ -38,7 +38,7 @@ public: |
278 |
+ void setPath(const QUrl &url); |
279 |
+ void setFileType(int filetype); |
280 |
+ void setMimeType(const QStringList &mimetype); |
281 |
+- void setContext(const QString &context, bool casesensitive, bool search_binary, bool useRegexp); |
282 |
++ void setContext(const QString &context, bool casesensitive, bool search_binary); |
283 |
+ void setUsername(const QString &username); |
284 |
+ void setGroupname(const QString &groupname); |
285 |
+ void setMetaInfo(const QString &metainfo, const QString &metainfokey); |
286 |
+@@ -93,7 +93,6 @@ private: |
287 |
+ QString m_metainfokey; |
288 |
+ bool m_casesensitive; |
289 |
+ bool m_search_binary; |
290 |
+- bool m_regexpForContent; |
291 |
+ bool m_useLocate; |
292 |
+ bool m_showHiddenFiles; |
293 |
+ QByteArray bufferLocate; |
294 |
+-- |
295 |
+GitLab |
296 |
+ |
297 |
|
298 |
diff --git a/kde-apps/kfind/kfind-21.04.3-r1.ebuild b/kde-apps/kfind/kfind-21.04.3-r1.ebuild |
299 |
new file mode 100644 |
300 |
index 00000000000..96d049f4505 |
301 |
--- /dev/null |
302 |
+++ b/kde-apps/kfind/kfind-21.04.3-r1.ebuild |
303 |
@@ -0,0 +1,39 @@ |
304 |
+# Copyright 1999-2021 Gentoo Authors |
305 |
+# Distributed under the terms of the GNU General Public License v2 |
306 |
+ |
307 |
+EAPI=7 |
308 |
+ |
309 |
+ECM_HANDBOOK="forceoptional" |
310 |
+KFMIN=5.80.0 |
311 |
+QTMIN=5.15.2 |
312 |
+inherit ecm kde.org |
313 |
+ |
314 |
+DESCRIPTION="File finder utility based on KDE Frameworks" |
315 |
+HOMEPAGE="https://apps.kde.org/kfind/" |
316 |
+ |
317 |
+LICENSE="GPL-2" # TODO: CHECK |
318 |
+SLOT="5" |
319 |
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" |
320 |
+IUSE="" |
321 |
+ |
322 |
+RDEPEND=" |
323 |
+ >=dev-qt/qtgui-${QTMIN}:5 |
324 |
+ >=dev-qt/qtwidgets-${QTMIN}:5 |
325 |
+ >=kde-frameworks/karchive-${KFMIN}:5 |
326 |
+ >=kde-frameworks/kcompletion-${KFMIN}:5 |
327 |
+ >=kde-frameworks/kconfig-${KFMIN}:5 |
328 |
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5 |
329 |
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5 |
330 |
+ >=kde-frameworks/kfilemetadata-${KFMIN}:5 |
331 |
+ >=kde-frameworks/ki18n-${KFMIN}:5 |
332 |
+ >=kde-frameworks/kio-${KFMIN}:5 |
333 |
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5 |
334 |
+ >=kde-frameworks/kservice-${KFMIN}:5 |
335 |
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5 |
336 |
+ >=kde-frameworks/kxmlgui-${KFMIN}:5 |
337 |
+" |
338 |
+DEPEND="${RDEPEND} |
339 |
+ >=dev-qt/qtconcurrent-${QTMIN}:5 |
340 |
+" |
341 |
+ |
342 |
+PATCHES=( "${FILESDIR}/${P}-unused-dep.patch" ) |