Index: head/sysutils/krename/Makefile =================================================================== --- head/sysutils/krename/Makefile (revision 560414) +++ head/sysutils/krename/Makefile (revision 560415) @@ -1,27 +1,26 @@ # $FreeBSD$ PORTNAME= krename -PORTVERSION= 5.0.0 -PORTREVISION= 7 +PORTVERSION= 5.0.1 CATEGORIES= sysutils kde MASTER_SITES= KDE/stable/${PORTNAME}/${PORTVERSION}/src MAINTAINER= kde@FreeBSD.org COMMENT= Powerful batch file renamer for KDE LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libtag.so:audio/taglib \ libexiv2.so:graphics/exiv2 \ libpodofo.so:graphics/podofo \ libfreetype.so:print/freetype2 -USES= cmake compiler:c++11-lang gettext kde:5 qt:5 tar:xz +USES= cmake compiler:c++11-lang gettext kde:5 pkgconfig qt:5 tar:xz USE_KDE= auth bookmarks codecs completion config configwidgets \ coreaddons crash i18n iconthemes itemviews jobwidgets \ - js kio service solid widgetsaddons xmlgui -USE_QT= concurrent core dbus gui network xml widgets \ + kio service solid widgetsaddons windowsystem xmlgui +USE_QT= concurrent core dbus declarative gui network xml widgets \ buildtools_build qmake_build .include Index: head/sysutils/krename/distinfo =================================================================== --- head/sysutils/krename/distinfo (revision 560414) +++ head/sysutils/krename/distinfo (revision 560415) @@ -1,3 +1,3 @@ -TIMESTAMP = 1518723952 -SHA256 (krename-5.0.0.tar.xz) = 0a61761853787fd46b35f3a733cf87cde00de5df631728332a64c38c670bd28c -SIZE (krename-5.0.0.tar.xz) = 279968 +TIMESTAMP = 1609867359 +SHA256 (krename-5.0.1.tar.xz) = caac78afd3ba06613df47bbd1570bb900acf4185547354d6eb588e70656f6a7d +SIZE (krename-5.0.1.tar.xz) = 321556 Index: head/sysutils/krename/files/patch-gentoo_git-krename-5.0.0-exiv2-0.27.patch =================================================================== --- head/sysutils/krename/files/patch-gentoo_git-krename-5.0.0-exiv2-0.27.patch (revision 560414) +++ head/sysutils/krename/files/patch-gentoo_git-krename-5.0.0-exiv2-0.27.patch (nonexistent) @@ -1,198 +0,0 @@ -https://github.com/KDE/krename/commit/b22de9135ba2a5abdbd2b275a60933a50f074010 -https://gitweb.gentoo.org/repo/gentoo.git/tree/kde-misc/krename/files/krename-5.0.0-exiv2-0.27.patch - - -From ec90823494f5ec9bb2e8098f44209f383ef8c22a Mon Sep 17 00:00:00 2001 -From: Heiko Becker -Date: Tue, 20 Nov 2018 18:24:29 +0100 -Subject: Use #cmakedefine01 instead of macro_bool_to_01 - ---- - CMakeLists.txt | 13 +++++-------- - config-krename.h.cmake | 10 +++++----- - 3 files changed, 10 insertions(+), 33 deletions(-) - delete mode 100644 cmake/modules/MacroBoolTo01.cmake - ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -80,13 +80,10 @@ set_package_properties(Freetype PROPERTIES - - feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) - -- --# Update configuration --include(MacroBoolTo01) --macro_bool_to_01(TAGLIB_FOUND HAVE_TAGLIB) --macro_bool_to_01(EXIV2_FOUND HAVE_EXIV2) --macro_bool_to_01(PoDoFo_FOUND HAVE_PODOFO) --macro_bool_to_01(FREETYPE_FOUND HAVE_FREETYPE) -+set(HAVE_TAGLIB ${TAGLIB_FOUND}) -+set(HAVE_EXIV2 ${LibExiv2_FOUND}) -+set(HAVE_PODOFO ${PoDoFo_FOUND}) -+set(HAVE_FREETYPE ${FREETYPE_FOUND}) - configure_file(config-krename.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-krename.h) - - # Directories ---- config-krename.h.cmake -+++ config-krename.h.cmake -@@ -1,15 +1,15 @@ - /* config.h. Generated by cmake from config.h.cmake */ - - /* have TagLib */ --#define HAVE_TAGLIB ${HAVE_TAGLIB} -+#cmakedefine01 HAVE_TAGLIB - - /* have Exiv2 */ --#define HAVE_EXIV2 ${HAVE_EXIV2} -+#cmakedefine01 HAVE_EXIV2 - - /* have PoDoFo */ --#define HAVE_PODOFO ${HAVE_PODOFO} -+#cmakedefine01 HAVE_PODOFO - - /* have Freetype */ --#define HAVE_FREETYPE ${HAVE_FREETYPE} -+#cmakedefine01 HAVE_FREETYPE - --#define VERSION "${KRENAME_VERSION}" -+#define VERSION "${krename_VERSION}" --- -cgit v1.1 - -From b22de9135ba2a5abdbd2b275a60933a50f074010 Mon Sep 17 00:00:00 2001 -From: Heiko Becker -Date: Tue, 20 Nov 2018 18:26:47 +0100 -Subject: Fix building against exiv2-0.27 - -One neeeded part is to copy over the new FindLibExiv2 module from -ECM which has not appeared in a release yet (it will with 5.53.0). -I'll probably add that version as a requirement and remove the copy -again in the near future. -The other part includes raising the cmake version requirement to -3.7.0, which was released over 2 years ago. (The version comparison -could be easily solved differently and less elegantly, but let's see -if people with ancient cmakes complain). ---- - CMakeLists.txt | 15 ++--- - config-krename.h.cmake | 3 + - src/CMakeLists.txt | 8 +-- - src/exiv2plugin.cpp | 8 ++- - 6 files changed, 137 insertions(+), 91 deletions(-) - delete mode 100644 cmake/modules/FindExiv2.cmake - create mode 100644 cmake/modules/FindLibExiv2.cmake - -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -1,4 +1,5 @@ --project(krename) - --cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) -+cmake_minimum_required(VERSION 3.7) -+ -+project(krename VERSION "5.0.0") - -@@ -39,10 +40,6 @@ add_definitions( - -DQT_STRICT_ITERATORS - ) - --set(KRENAME_VERSION "5.0.0") -- --include(FindGettext) -- - # Find taglib - set(TAGLIB_MIN_VERSION "1.5") - find_package(Taglib ${TAGLIB_MIN_VERSION}) -@@ -58,11 +55,12 @@ set_package_properties(Taglib PROPERTIES - TYPE OPTIONAL) - - # Find exiv2 --find_package(Exiv2 0.13) # AccessMode was added in 0.13 --set_package_properties(Exiv2 PROPERTIES -- DESCRIPTION "A library to access image metadata" -- URL "http://www.exiv2.org" -- TYPE OPTIONAL) -+find_package(LibExiv2 0.13) # AccessMode was added in 0.13 -+set_package_properties(LibExiv2 PROPERTIES TYPE OPTIONAL) -+ -+if (LibExiv2_VERSION VERSION_GREATER_EQUAL "0.27") -+ set(HAVE_LIBEXIV2_0_27 TRUE) -+endif() - - # Find podofo - find_package(PoDoFo) ---- config-krename.h.cmake -+++ config-krename.h.cmake -@@ -6,6 +6,9 @@ - /* have Exiv2 */ - #cmakedefine01 HAVE_EXIV2 - -+/* Defined if we have libexiv2 >= 0.27 */ -+#cmakedefine HAVE_LIBEXIV2_0_27 -+ - /* have PoDoFo */ - #cmakedefine01 HAVE_PODOFO - ---- src/CMakeLists.txt -+++ src/CMakeLists.txt -@@ -23,7 +23,10 @@ if(FREETYPE_FOUND) - include_directories(${FREETYPE_INCLUDE_DIRS}) - endif() - --add_definitions(${TAGLIB_CFLAGS} ${EXIV2_CFLAGS}) -+add_definitions(${TAGLIB_CFLAGS}) -+if(NOT TAGLIB_LIBRARIES) -+ set(TAGLIB_LIBRARIES Taglib::Taglib) -+endif() - # Exiv2 needs exceptions - kde_enable_exceptions() - -@@ -67,7 +67,7 @@ set(krename_SRCS - snumplugin.cpp - ) - --if(EXIV2_FOUND) -+if(LibExiv2_FOUND) - set(krename_SRCS ${krename_SRCS} - exiv2plugin.cpp - ) -@@ -128,12 +128,12 @@ target_link_libraries(krename - ) - if(TAGLIB_FOUND) - target_link_libraries(krename - ${TAGLIB_LIBRARIES} - ) - endif() --if(EXIV2_FOUND) -+if(LibExiv2_FOUND) - target_link_libraries(krename -- ${EXIV2_LIBRARIES} -+ LibExiv2::LibExiv2 - ) - endif() - if(PoDoFo_FOUND) ---- src/exiv2plugin.cpp -+++ src/exiv2plugin.cpp -@@ -17,13 +17,19 @@ - - #include "exiv2plugin.h" - -+#include "../config-krename.h" -+ - #include - - #include - #include - #include - #include --#include -+#ifdef HAVE_LIBEXIV2_0_27 -+ #include -+#else -+ #include -+#endif - #include - - #include "batchrenamer.h" --- -cgit v1.1 Property changes on: head/sysutils/krename/files/patch-gentoo_git-krename-5.0.0-exiv2-0.27.patch ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/krename/files/patch-gentoo_git-krename-5.0.1-no-kjs.patch =================================================================== --- head/sysutils/krename/files/patch-gentoo_git-krename-5.0.1-no-kjs.patch (nonexistent) +++ head/sysutils/krename/files/patch-gentoo_git-krename-5.0.1-no-kjs.patch (revision 560415) @@ -0,0 +1,521 @@ +https://gitweb.gentoo.org/repo/gentoo.git/tree/kde-misc/krename/files/krename-5.0.1-no-kjs.patch + +From 407b612a93128b9f935a686d5ff82c7ee06087f5 Mon Sep 17 00:00:00 2001 +From: Harald Sitter +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 src/scriptplugin.cpp +index 0790fd4..8f4b11e 100644 +--- a/src/scriptplugin.cpp ++++ 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(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(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 +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 src/scriptplugin.cpp src/scriptplugin.cpp +index 8f4b11e..fec61e7 100644 +--- src/scriptplugin.cpp ++++ src/scriptplugin.cpp +@@ -28,7 +28,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -228,7 +227,7 @@ void ScriptPlugin::slotEnableControls() + + void ScriptPlugin::slotAdd() + { +- QPointer 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 +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 src/scriptplugin.cpp src/scriptplugin.cpp +index fec61e7..1933bc6 100644 +--- src/scriptplugin.cpp ++++ 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 + ***************************************************************************/ + + /*************************************************************************** +@@ -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 +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 src/previewlist.cpp src/previewlist.cpp +index df8097b..0d3ccb6 100644 +--- src/previewlist.cpp ++++ 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 src/progressdialog.cpp src/progressdialog.cpp +index 4eaaf1a..d217614 100644 +--- src/progressdialog.cpp ++++ 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 src/scriptplugin.cpp src/scriptplugin.cpp +index 1933bc6..46b27ca 100644 +--- src/scriptplugin.cpp ++++ 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 +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 CMakeLists.txt CMakeLists.txt +index 2b39e18..e1673e1 100644 +--- CMakeLists.txt ++++ 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 src/CMakeLists.txt src/CMakeLists.txt +index 3f262b3..bee7378 100644 +--- src/CMakeLists.txt ++++ 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 src/scriptplugin.cpp src/scriptplugin.cpp +index d7f7125..651e656 100644 +--- src/scriptplugin.cpp ++++ src/scriptplugin.cpp +@@ -18,8 +18,7 @@ + #include + #include + #include +- +-#include ++#include + + #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 src/scriptplugin.h src/scriptplugin.h +index 367310b..f91e79b 100644 +--- src/scriptplugin.h ++++ src/scriptplugin.h +@@ -3,9 +3,10 @@ + + #include "plugin.h" + ++#include ++ + 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 + Property changes on: head/sysutils/krename/files/patch-gentoo_git-krename-5.0.1-no-kjs.patch ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/krename/pkg-plist =================================================================== --- head/sysutils/krename/pkg-plist (revision 560414) +++ head/sysutils/krename/pkg-plist (revision 560415) @@ -1,37 +1,44 @@ bin/krename share/applications/org.kde.krename.desktop share/icons/hicolor/32x32/apps/krename.png share/icons/hicolor/48x48/apps/krename.png share/icons/locolor/16x16/apps/krename.png share/icons/locolor/32x32/apps/krename.png share/kservices5/ServiceMenus/krename_all_nonrec.desktop share/kservices5/ServiceMenus/krename_dir_rec.desktop share/locale/ar/LC_MESSAGES/krename.mo share/locale/ast/LC_MESSAGES/krename.mo share/locale/bs/LC_MESSAGES/krename.mo share/locale/ca/LC_MESSAGES/krename.mo share/locale/ca@valencia/LC_MESSAGES/krename.mo share/locale/cs/LC_MESSAGES/krename.mo share/locale/da/LC_MESSAGES/krename.mo share/locale/de/LC_MESSAGES/krename.mo share/locale/el/LC_MESSAGES/krename.mo share/locale/en_GB/LC_MESSAGES/krename.mo share/locale/es/LC_MESSAGES/krename.mo +share/locale/eu/LC_MESSAGES/krename.mo share/locale/fi/LC_MESSAGES/krename.mo share/locale/fr/LC_MESSAGES/krename.mo +share/locale/gl/LC_MESSAGES/krename.mo share/locale/hu/LC_MESSAGES/krename.mo +share/locale/ia/LC_MESSAGES/krename.mo share/locale/it/LC_MESSAGES/krename.mo share/locale/ja/LC_MESSAGES/krename.mo +share/locale/ko/LC_MESSAGES/krename.mo share/locale/lt/LC_MESSAGES/krename.mo share/locale/nl/LC_MESSAGES/krename.mo +share/locale/nn/LC_MESSAGES/krename.mo share/locale/pl/LC_MESSAGES/krename.mo +share/locale/pt_BR/LC_MESSAGES/krename.mo share/locale/pt/LC_MESSAGES/krename.mo +share/locale/ro/LC_MESSAGES/krename.mo share/locale/ru/LC_MESSAGES/krename.mo share/locale/sk/LC_MESSAGES/krename.mo share/locale/sl/LC_MESSAGES/krename.mo share/locale/sv/LC_MESSAGES/krename.mo share/locale/tr/LC_MESSAGES/krename.mo share/locale/uk/LC_MESSAGES/krename.mo share/locale/zh_CN/LC_MESSAGES/krename.mo share/locale/zh_TW/LC_MESSAGES/krename.mo share/metainfo/org.kde.krename.appdata.xml