summaryrefslogtreecommitdiff
path: root/kde-misc/krename
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-05-28 15:14:55 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-05-28 15:14:55 +0100
commite5346f2f512bd7faf413f3de3ef7fbcfbcd974b3 (patch)
tree44147dcd86c1974cea8fa5e6914b2b4428d4ec28 /kde-misc/krename
parentdd543f86f47d3b1796d2190759773c75779ba7ad (diff)
gentoo auto-resync : 28:05:2023 - 15:14:55
Diffstat (limited to 'kde-misc/krename')
-rw-r--r--kde-misc/krename/Manifest5
-rw-r--r--kde-misc/krename/files/krename-5.0.1-no-kjs.patch519
-rw-r--r--kde-misc/krename/krename-5.0.2-r1.ebuild59
-rw-r--r--kde-misc/krename/krename-5.0.2.ebuild7
4 files changed, 66 insertions, 524 deletions
diff --git a/kde-misc/krename/Manifest b/kde-misc/krename/Manifest
index 8fd2b6645330..18473e5243c5 100644
--- a/kde-misc/krename/Manifest
+++ b/kde-misc/krename/Manifest
@@ -1,4 +1,5 @@
-AUX krename-5.0.1-no-kjs.patch 20279 BLAKE2B 06a3267c03489c06122fccb65b7ce317dca41ac9531f5c3db1b0f315361b2b02ee9877bd9d5920b40339414f7e73c08f723934993254f1f6be0394dddd062dfb SHA512 24ea4270caa76a44132d8412ea7209a436710d8e6a35033a6218451bc71cd94814faf42336390e9f4a41d856d749d7efca424a0922408279e89664c3b6f253e2
+DIST krename-5.0.2-patchset-1.tar.xz 6360 BLAKE2B 69e8b046885be27c77d5d315e994e8b2a31e76ed76f4ea6d030679b83133725cb0577d818841b1f41e566e757f4cbd4e08c1f479bc1d572a8391db47c4a26e8c SHA512 2de0ee19d29dadb50995b0d02e486e8efdbff3d3fda0a3a6ec69f4b5858b4c376b3d33d2018da0cf2333309fe8b4ea58f4de21f6d2864c2c22b60830b5ac9bcf
DIST krename-5.0.2.tar.xz 337908 BLAKE2B 2fb7a96ca3f3f3b193d0924dd1131a7442b32149c1f62387734c47680077b6f77e3cf32b940b85d6f688d24f24af08ac39a8ccc86f10f5ec1d65b53fc9631108 SHA512 c065d6de90c43e5297db2773d8569279535b007d3b00b99a252329e78c90dc949678ecd2f2ecaa74e72394fa0e848b8774f6f387d4a7f367b367b1dd38405545
-EBUILD krename-5.0.2.ebuild 1537 BLAKE2B 4bcdbbdd190da8f6472e767adfc38bc7f4915d46f262f8fb4e7c9412dc513c615434d57b971be3c507f480ab9e6ca89fb6cd729680c06fd0de98a0e656c89c87 SHA512 620ee01a89535c5afeac2e123e14ce91548408fcdc394ca66e0df5ac0add4a76fb8f338efb48b8b11a64083c94bd36a264bbf7612bb9302def309d317da2ea70
+EBUILD krename-5.0.2-r1.ebuild 1618 BLAKE2B 5925e46d5921fc2f5f797e75b4a90262e49f6a3a22a80513986b81ae933024d871db8ee71367aff6b3b7d31faa65be1f1434aef5f576eeb5d30b86f3767d4cad SHA512 7a5f2b3f2b8e08f197d4fe3eef843339b55c861d6b31c2f6674870f4f08cf7f20471bcee36067c2b99ca8f46b49b822e12e86aa9fc3bb8786ebf03ffbc73a2e1
+EBUILD krename-5.0.2.ebuild 1625 BLAKE2B 6c0eb982652d67261fec1327093fa27cb3661fec64f15892c0658938041816eca0e579f94faff3c09a179ed37c8675f39179d006a0da5018600ff7a6c5ef51de SHA512 9c10a22507a4bcfce7454fe428c1ca4992745ecc500af806356292119c1f348ee62e988a4c5df95f1df790b2034d97fb8d3ce3a6f3c825979e3d9d97bcb3dac3
MISC metadata.xml 318 BLAKE2B 922a5e32e706b2976c5f359a14194d268d3f499398576c80ce5fad8c0fcea0fbf048de4480a80a6a1889c88b8b6c14147654a3ab4d5ffbcc258c2290da63f6d1 SHA512 614cb8dda7ad2088e5d6ef39b449bb4be0ac72cd0231c320188d76d1816dce6490c5114bb4798112c4b11d99d30a9e82ff8fcf08ffa8c049589682a5e38208f6
diff --git a/kde-misc/krename/files/krename-5.0.1-no-kjs.patch b/kde-misc/krename/files/krename-5.0.1-no-kjs.patch
deleted file mode 100644
index f4b7eb786890..000000000000
--- a/kde-misc/krename/files/krename-5.0.1-no-kjs.patch
+++ /dev/null
@@ -1,519 +0,0 @@
-From 407b612a93128b9f935a686d5ff82c7ee06087f5 Mon Sep 17 00:00:00 2001
-From: Harald Sitter <sitter@kde.org>
-Date: Thu, 17 Dec 2020 13:19:56 +0100
-Subject: [PATCH 1/5] reduce nesting
-
-easier on the eyes
----
- src/scriptplugin.cpp | 63 +++++++++++++++++++++++---------------------
- 1 file changed, 33 insertions(+), 30 deletions(-)
-
-diff --git a/src/scriptplugin.cpp b/src/scriptplugin.cpp
-index 0790fd4..8f4b11e 100644
---- a/src/scriptplugin.cpp
-+++ b/src/scriptplugin.cpp
-@@ -175,36 +175,39 @@ void ScriptPlugin::initKRenameVars(const KRenameFile &file, int index)
- file.srcDirectory());
-
- // User definitions, set them only on first file
-- if (index == 0) {
-- for (int i = 0; i < m_widget->listVariables->topLevelItemCount(); i++) {
-- // TODO, we have to know the type of the variable!
-- QTreeWidgetItem *item = m_widget->listVariables->topLevelItem(i);
-- if (item) {
-- EVarType eVarType = static_cast<EVarType>(item->data(1, Qt::UserRole).toInt());
-- const QString &name = item->text(0);
-- const QString &value = item->text(1);
-- switch (eVarType) {
-- default:
-- case eVarType_String:
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- name, value.toUtf8().data());
-- break;
-- case eVarType_Int:
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- name, value.toInt());
-- break;
-- case eVarType_Double:
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- name, value.toDouble());
-- break;
-- case eVarType_Bool:
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- name,
-- (value.toLower() == "true" ? true : false));
-- break;
--
-- }
-- }
-+ if (index != 0) {
-+ return;
-+ }
-+
-+ for (int i = 0; i < m_widget->listVariables->topLevelItemCount(); i++) {
-+ // TODO, we have to know the type of the variable!
-+ QTreeWidgetItem *item = m_widget->listVariables->topLevelItem(i);
-+ if (!item) {
-+ continue;
-+ }
-+
-+ EVarType eVarType = static_cast<EVarType>(item->data(1, Qt::UserRole).toInt());
-+ const QString &name = item->text(0);
-+ const QString &value = item->text(1);
-+ switch (eVarType) {
-+ default:
-+ case eVarType_String:
-+ m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-+ name, value.toUtf8().data());
-+ break;
-+ case eVarType_Int:
-+ m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-+ name, value.toInt());
-+ break;
-+ case eVarType_Double:
-+ m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-+ name, value.toDouble());
-+ break;
-+ case eVarType_Bool:
-+ m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-+ name,
-+ (value.toLower() == "true" ? true : false));
-+ break;
- }
- }
- }
---
-2.29.2
-
-
-From f80de4b81846da45c4cc16c585a159872dcc2c29 Mon Sep 17 00:00:00 2001
-From: Harald Sitter <sitter@kde.org>
-Date: Thu, 17 Dec 2020 13:24:37 +0100
-Subject: [PATCH 2/5] don't needlessly use qpointer
-
-for one it has no value, scopedpointer might. we don't need a pointer
-at all though, simply put qdialog on the stack and let the compiler
-take care of it
----
- src/scriptplugin.cpp | 44 ++++++++++++++++++++++----------------------
- 1 file changed, 22 insertions(+), 22 deletions(-)
-
-diff --git a/src/scriptplugin.cpp b/src/scriptplugin.cpp
-index 8f4b11e..fec61e7 100644
---- a/src/scriptplugin.cpp
-+++ b/src/scriptplugin.cpp
-@@ -28,7 +28,6 @@
- #include <QTemporaryFile>
- #include <QFile>
- #include <QMenu>
--#include <QPointer>
- #include <QTextStream>
- #include <QVariant>
- #include <QFileDialog>
-@@ -228,7 +227,7 @@ void ScriptPlugin::slotEnableControls()
-
- void ScriptPlugin::slotAdd()
- {
-- QPointer<QDialog> dialog = new QDialog();
-+ QDialog dialog;
- Ui::ScriptPluginDialog dlg;
-
- QStringList types;
-@@ -238,32 +237,33 @@ void ScriptPlugin::slotAdd()
- types << i18n("Double");
- types << i18n("Boolean");
-
-- dlg.setupUi(dialog);
-+ dlg.setupUi(&dialog);
- dlg.comboType->addItems(types);
-
-- if (dialog->exec() == QDialog::Accepted) {
-- QString name = dlg.lineName->text();
-- QString value = dlg.lineValue->text();
-+ if (dialog.exec() != QDialog::Accepted) {
-+ return;
-+ }
-
-- // Build a Java script statement
-- QString script = name + " = " + value + ';';
-+ QString name = dlg.lineName->text();
-+ QString value = dlg.lineValue->text();
-
-- KJSInterpreter interpreter;
-- KJSResult result = m_interpreter->evaluate(script, nullptr);
-- if (result.isException()) {
-- KMessageBox::error(m_parent,
-- i18n("A JavaScript error has occurred: ") +
-- result.errorMessage(), this->name());
-- } else {
-- QTreeWidgetItem *item = new QTreeWidgetItem();
-- item->setText(0, name);
-- item->setText(1, value);
-- item->setData(1, Qt::UserRole, QVariant(dlg.comboType->currentIndex()));
-+ // Build a Java script statement
-+ QString script = name + " = " + value + ';';
-
-- m_widget->listVariables->addTopLevelItem(item);
-- }
-+ KJSInterpreter interpreter;
-+ KJSResult result = m_interpreter->evaluate(script, nullptr);
-+ if (result.isException()) {
-+ KMessageBox::error(m_parent,
-+ i18n("A JavaScript error has occurred: ") +
-+ result.errorMessage(), this->name());
-+ } else {
-+ QTreeWidgetItem *item = new QTreeWidgetItem();
-+ item->setText(0, name);
-+ item->setText(1, value);
-+ item->setData(1, Qt::UserRole, QVariant(dlg.comboType->currentIndex()));
-+
-+ m_widget->listVariables->addTopLevelItem(item);
- }
-- delete dialog;
- }
-
- void ScriptPlugin::slotRemove()
---
-2.29.2
-
-
-From 5979b30da5b385008894ff5577da917dd888959e Mon Sep 17 00:00:00 2001
-From: Harald Sitter <sitter@kde.org>
-Date: Thu, 17 Dec 2020 13:32:41 +0100
-Subject: [PATCH 3/5] fix dangerously implicit int->int->enum mapping
-
-the type order in the qstringlist was implicitly the int values of the
-type enum. incredibly scary. instead push the items into the combobox
-along with their enum value as Qt::UserRole and then pass that along.
-this ensures (kind of) that the int we cast back to enum in
-initKRenameVars will be an actual enum value
----
- src/scriptplugin.cpp | 15 ++++++---------
- 1 file changed, 6 insertions(+), 9 deletions(-)
-
-diff --git a/src/scriptplugin.cpp b/src/scriptplugin.cpp
-index fec61e7..1933bc6 100644
---- a/src/scriptplugin.cpp
-+++ b/src/scriptplugin.cpp
-@@ -4,6 +4,7 @@
- begin : Fri Nov 9 2007
- copyright : (C) 2007 by Dominik Seichter
- email : domseichter@web.de
-+ copyright : (C) 2020 by Harald Sitter <sitter@kde.org>
- ***************************************************************************/
-
- /***************************************************************************
-@@ -230,15 +231,11 @@ void ScriptPlugin::slotAdd()
- QDialog dialog;
- Ui::ScriptPluginDialog dlg;
-
-- QStringList types;
--
-- types << i18n("String");
-- types << i18n("Int");
-- types << i18n("Double");
-- types << i18n("Boolean");
--
- dlg.setupUi(&dialog);
-- dlg.comboType->addItems(types);
-+ dlg.comboType->addItem(i18n("String"), eVarType_String);
-+ dlg.comboType->addItem(i18n("Int"), eVarType_Int);
-+ dlg.comboType->addItem(i18n("Double"), eVarType_Double);
-+ dlg.comboType->addItem(i18n("Boolean"), eVarType_Bool);
-
- if (dialog.exec() != QDialog::Accepted) {
- return;
-@@ -260,7 +257,7 @@ void ScriptPlugin::slotAdd()
- QTreeWidgetItem *item = new QTreeWidgetItem();
- item->setText(0, name);
- item->setText(1, value);
-- item->setData(1, Qt::UserRole, QVariant(dlg.comboType->currentIndex()));
-+ item->setData(1, Qt::UserRole, dlg.comboType->currentData());
-
- m_widget->listVariables->addTopLevelItem(item);
- }
---
-2.29.2
-
-
-From 82161c323b7b0d4b77602551923118f304c5c536 Mon Sep 17 00:00:00 2001
-From: Harald Sitter <sitter@kde.org>
-Date: Thu, 17 Dec 2020 15:05:49 +0100
-Subject: [PATCH 4/5] port away from stringy QMenu::addAction to functor based
- API
-
-was introdcued in 5.6 so is fine to use and loads safer
----
- src/previewlist.cpp | 8 ++++----
- src/progressdialog.cpp | 8 ++++----
- src/scriptplugin.cpp | 10 +++++-----
- 3 files changed, 13 insertions(+), 13 deletions(-)
-
-diff --git a/src/previewlist.cpp b/src/previewlist.cpp
-index df8097b..0d3ccb6 100644
---- a/src/previewlist.cpp
-+++ b/src/previewlist.cpp
-@@ -28,12 +28,12 @@ PreviewList::PreviewList(QWidget *parent)
- : QTreeView(parent), m_model(nullptr)
- {
- m_menu = new QMenu("KRename", this); // we need any text here so that we have a title
-- m_menu->addAction(i18n("&Change filename manually..."), this, SLOT(slotManually()), QKeySequence("F2"));
-+ m_menu->addAction(i18n("&Change filename manually..."), this, &PreviewList::slotManually, QKeySequence("F2"));
- m_menu->addSeparator();
-- m_menu->addAction(i18n("&Open"), this, SLOT(slotOpen()));
-+ m_menu->addAction(i18n("&Open"), this, &PreviewList::slotOpen);
- m_menu->addSeparator();
-- m_menu->addAction(i18n("&Add..."), this, SIGNAL(addFiles()));
-- m_menu->addAction(i18n("&Remove"), this, SLOT(slotRemove()));
-+ m_menu->addAction(i18n("&Add..."), this, &PreviewList::addFiles);
-+ m_menu->addAction(i18n("&Remove"), this, &PreviewList::slotRemove);
-
- connect(this, &PreviewList::activated, this, &PreviewList::slotManually);
- }
-diff --git a/src/progressdialog.cpp b/src/progressdialog.cpp
-index 4eaaf1a..d217614 100644
---- a/src/progressdialog.cpp
-+++ b/src/progressdialog.cpp
-@@ -49,11 +49,11 @@ ProgressDialog::ProgressDialog(ESplitMode eSplitMode, unsigned int dot, QWidget
- qApp, &QApplication::quit, Qt::QueuedConnection);
-
- QMenu *menu = new QMenu(this);
-- menu->addAction(i18n("Restart &KRename..."), this, SLOT(slotRestartKRename()));
-+ menu->addAction(i18n("Restart &KRename..."), this, &ProgressDialog::slotRestartKRename);
- menu->addSeparator();
-- m_actProcessed = menu->addAction(i18n("Rename Processed Files &Again..."), this, SLOT(slotRenameProcessedAgain()));
-- m_actUnprocessed = menu->addAction(i18n("Rename &Unprocessed Files Again..."), this, SLOT(slotRenameUnprocessedAgain()));
-- menu->addAction(i18n("&Rename All Files Again..."), this, SLOT(slotRenameAllAgain()));
-+ m_actProcessed = menu->addAction(i18n("Rename Processed Files &Again..."), this, &ProgressDialog::slotRenameProcessedAgain);
-+ m_actUnprocessed = menu->addAction(i18n("Rename &Unprocessed Files Again..."), this, &ProgressDialog::slotRenameUnprocessedAgain);
-+ menu->addAction(i18n("&Rename All Files Again..."), this, &ProgressDialog::slotRenameAllAgain);
-
- m_buttonMore->setMenu(menu);
- }
-diff --git a/src/scriptplugin.cpp b/src/scriptplugin.cpp
-index 1933bc6..46b27ca 100644
---- a/src/scriptplugin.cpp
-+++ b/src/scriptplugin.cpp
-@@ -68,11 +68,11 @@ ScriptPlugin::ScriptPlugin(PluginLoader *loader)
-
- m_help.append("[js;4+5];;" + i18n("Insert a snippet of JavaScript code (4+5 in this case)"));
-
-- m_menu->addAction(i18n("Index of the current file"), this, SLOT(slotInsertIndex()));
-- m_menu->addAction(i18n("URL of the current file"), this, SLOT(slotInsertUrl()));
-- m_menu->addAction(i18n("Filename of the current file"), this, SLOT(slotInsertFilename()));
-- m_menu->addAction(i18n("Extension of the current file"), this, SLOT(slotInsertExtension()));
-- m_menu->addAction(i18n("Directory of the current file"), this, SLOT(slotInsertDirectory()));
-+ m_menu->addAction(i18n("Index of the current file"), this, &ScriptPlugin::slotInsertIndex);
-+ m_menu->addAction(i18n("URL of the current file"), this, &ScriptPlugin::slotInsertUrl);
-+ m_menu->addAction(i18n("Filename of the current file"), this, &ScriptPlugin::slotInsertFilename);
-+ m_menu->addAction(i18n("Extension of the current file"), this, &ScriptPlugin::slotInsertExtension);
-+ m_menu->addAction(i18n("Directory of the current file"), this, &ScriptPlugin::slotInsertDirectory);
- }
-
- ScriptPlugin::~ScriptPlugin()
---
-2.29.2
-
-
-From e0a93830d0ea0c71ab649b7e68af0238bd48eb10 Mon Sep 17 00:00:00 2001
-From: Harald Sitter <sitter@kde.org>
-Date: Thu, 17 Dec 2020 13:45:07 +0100
-Subject: [PATCH 5/5] port from deprecated kjs to qjsengine
-
-for kf6 todo https://phabricator.kde.org/T11604
-
-kjs is deprecated and we want to move away from it. this ports to
-qjsengine which does what we need for krename just fine and is also
-supported in qt6 still
-
-all use cases of the js plugin still seem to work fine. variable
-definition, function definition and using either in the replacement.
-same for the implicit global variables.
----
- CMakeLists.txt | 2 +-
- src/CMakeLists.txt | 2 +-
- src/scriptplugin.cpp | 55 ++++++++++++++------------------------------
- src/scriptplugin.h | 6 +++--
- 4 files changed, 23 insertions(+), 42 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 2b39e18..e1673e1 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -17,7 +17,7 @@ include(FeatureSummary)
- include(KDECompilerSettings NO_POLICY_SCOPE)
- include(FeatureSummary)
-
--find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
-+find_package(Qt5 REQUIRED COMPONENTS Core Qml Widgets)
- find_package(KF5 REQUIRED COMPONENTS
- Completion
- Config
-@@ -27,7 +27,6 @@ find_package(KF5 REQUIRED COMPONENTS
- IconThemes
- ItemViews
- JobWidgets
-- JS
- KIO
- Service
- WidgetsAddons
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index 3f262b3..bee7378 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -128,9 +128,9 @@ target_link_libraries(krename
- KF5::KIOCore
- KF5::KIOFileWidgets
- KF5::I18n
-- KF5::JSApi
- KF5::IconThemes
- Qt5::Widgets
-+ Qt5::Qml
- )
- if(TAGLIB_FOUND)
- target_link_libraries(krename
-diff --git a/src/scriptplugin.cpp b/src/scriptplugin.cpp
-index d7f7125..651e656 100644
---- a/src/scriptplugin.cpp
-+++ b/src/scriptplugin.cpp
-@@ -18,8 +18,7 @@
- #include <QTextStream>
- #include <QVariant>
- #include <QFileDialog>
--
--#include <kjs/kjsinterpreter.h>
-+#include <QDebug>
-
- #include "ui_scriptplugindialog.h"
- #include "ui_scriptpluginwidget.h"
-@@ -46,7 +45,6 @@ ScriptPlugin::ScriptPlugin(PluginLoader *loader)
- {
- m_name = i18n("JavaScript Plugin");
- m_icon = "applications-development";
-- m_interpreter = new KJSInterpreter();
- m_menu = new QMenu();
- m_widget = new Ui::ScriptPluginWidget();
-
-@@ -65,7 +63,6 @@ ScriptPlugin::~ScriptPlugin()
- {
- delete m_widget;
- delete m_menu;
-- delete m_interpreter;
- }
-
- QString ScriptPlugin::processFile(BatchRenamer *b, int index,
-@@ -90,13 +87,13 @@ QString ScriptPlugin::processFile(BatchRenamer *b, int index,
- // Make sure definitions are executed first
- script = definitions + '\n' + script;
-
-- KJSResult result = m_interpreter->evaluate(script, nullptr);
-- if (result.isException()) {
-- qDebug("JavaScript Error: %s", result.errorMessage().toUtf8().data());
-+ const QJSValue result = m_engine.evaluate(script);
-+ if (result.isError()) {
-+ qDebug() << "JavaScript Error:" << result.toString();
- return QString();
- }
-
-- return result.value().toString(m_interpreter->globalContext());
-+ return result.toString();
- }
-
- return QString();
-@@ -144,21 +141,11 @@ void ScriptPlugin::createUI(QWidget *parent) const
- void ScriptPlugin::initKRenameVars(const KRenameFile &file, int index)
- {
- // KRename definitions
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- ScriptPlugin::s_pszVarNameIndex,
-- index);
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- ScriptPlugin::s_pszVarNameUrl,
-- file.srcUrl().url());
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- ScriptPlugin::s_pszVarNameFilename,
-- file.srcFilename());
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- ScriptPlugin::s_pszVarNameExtension,
-- file.srcExtension());
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- ScriptPlugin::s_pszVarNameDirectory,
-- file.srcDirectory());
-+ m_engine.globalObject().setProperty(ScriptPlugin::s_pszVarNameIndex, index);
-+ m_engine.globalObject().setProperty(ScriptPlugin::s_pszVarNameUrl, file.srcUrl().url());
-+ m_engine.globalObject().setProperty(ScriptPlugin::s_pszVarNameFilename, file.srcFilename());
-+ m_engine.globalObject().setProperty(ScriptPlugin::s_pszVarNameExtension, file.srcExtension());
-+ m_engine.globalObject().setProperty(ScriptPlugin::s_pszVarNameDirectory, file.srcDirectory());
-
- // User definitions, set them only on first file
- if (index != 0) {
-@@ -178,21 +165,16 @@ void ScriptPlugin::initKRenameVars(const KRenameFile &file, int index)
- switch (eVarType) {
- default:
- case eVarType_String:
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- name, value.toUtf8().data());
-+ m_engine.globalObject().setProperty(name, value);
- break;
- case eVarType_Int:
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- name, value.toInt());
-+ m_engine.globalObject().setProperty(name, value.toInt());
- break;
- case eVarType_Double:
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- name, value.toDouble());
-+ m_engine.globalObject().setProperty(name, value.toDouble());
- break;
- case eVarType_Bool:
-- m_interpreter->globalObject().setProperty(m_interpreter->globalContext(),
-- name,
-- (value.toLower() == "true" ? true : false));
-+ m_engine.globalObject().setProperty(name, (value.toLower() == "true" ? true : false));
- break;
- }
- }
-@@ -233,12 +215,9 @@ void ScriptPlugin::slotAdd()
- // Build a Java script statement
- QString script = name + " = " + value + ';';
-
-- KJSInterpreter interpreter;
-- KJSResult result = m_interpreter->evaluate(script, nullptr);
-- if (result.isException()) {
-- KMessageBox::error(m_parent,
-- i18n("A JavaScript error has occurred: ") +
-- result.errorMessage(), this->name());
-+ const QJSValue result = m_engine.evaluate(script);
-+ if (result.isError()) {
-+ KMessageBox::error(m_parent, i18n("A JavaScript error has occurred: ") + result.toString(), this->name());
- } else {
- QTreeWidgetItem *item = new QTreeWidgetItem();
- item->setText(0, name);
-diff --git a/src/scriptplugin.h b/src/scriptplugin.h
-index 367310b..f91e79b 100644
---- a/src/scriptplugin.h
-+++ b/src/scriptplugin.h
-@@ -3,9 +3,10 @@
-
- #include "plugin.h"
-
-+#include <QJSEngine>
-+
- class QMenu;
-
--class KJSInterpreter;
- class KRenameFile;
-
- namespace Ui
-@@ -171,7 +173,7 @@ private:
-
- QStringList m_keys;
- QStringList m_help;
-- KJSInterpreter *m_interpreter;
-+ QJSEngine m_engine;
- QWidget *m_parent;
- QMenu *m_menu;
-
---
-2.29.2
-
diff --git a/kde-misc/krename/krename-5.0.2-r1.ebuild b/kde-misc/krename/krename-5.0.2-r1.ebuild
new file mode 100644
index 000000000000..5b56a51b4fe9
--- /dev/null
+++ b/kde-misc/krename/krename-5.0.2-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_TEST="true"
+KFMIN=5.82.0
+QTMIN=5.15.5
+inherit ecm kde.org
+
+DESCRIPTION="Powerful batch file renamer"
+HOMEPAGE="https://apps.kde.org/krename/ https://userbase.kde.org/KRename"
+
+if [[ ${KDE_BUILD_TYPE} != live ]]; then
+ SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz
+ https://dev.gentoo.org/~asturm/distfiles/${P}-patchset-1.tar.xz"
+ KEYWORDS="~amd64 ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="5"
+IUSE="exif pdf taglib truetype"
+
+DEPEND="
+ >=dev-qt/qtdeclarative-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=dev-qt/qtxml-${QTMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/kcrash-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kiconthemes-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/kitemviews-${KFMIN}:5
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5
+ >=kde-frameworks/kservice-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+ exif? ( media-gfx/exiv2:= )
+ pdf? ( app-text/podofo:= )
+ taglib? ( media-libs/taglib )
+ truetype? ( media-libs/freetype:2 )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="sys-devel/gettext"
+
+PATCHES=( "${WORKDIR}/${P}-patchset-1" ) # upstream, git master
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake_use_find_package exif LibExiv2)
+ $(cmake_use_find_package pdf PoDoFo)
+ $(cmake_use_find_package taglib Taglib)
+ $(cmake_use_find_package truetype Freetype)
+ )
+ ecm_src_configure
+}
diff --git a/kde-misc/krename/krename-5.0.2.ebuild b/kde-misc/krename/krename-5.0.2.ebuild
index 632cc5cb2f25..8f13ce26b5db 100644
--- a/kde-misc/krename/krename-5.0.2.ebuild
+++ b/kde-misc/krename/krename-5.0.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -12,7 +12,8 @@ DESCRIPTION="Powerful batch file renamer"
HOMEPAGE="https://apps.kde.org/krename/ https://userbase.kde.org/KRename"
if [[ ${KDE_BUILD_TYPE} != live ]]; then
- SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
+ SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz
+ https://dev.gentoo.org/~asturm/distfiles/${P}-patchset-1.tar.xz"
KEYWORDS="amd64 ~arm64 x86"
fi
@@ -45,7 +46,7 @@ DEPEND="
RDEPEND="${DEPEND}"
BDEPEND="sys-devel/gettext"
-PATCHES=( "${FILESDIR}/${PN}-5.0.1-no-kjs.patch" )
+PATCHES=( "${WORKDIR}/${PN}-5.0.2-patchset-1/${PN}-5.0.1-no-kjs.patch" )
src_configure() {
local mycmakeargs=(