Git commit 6bbbd0c313ba7689153d622558f81e5f0c12de5c by Volker Krause. Committed on 18/09/2019 at 16:34. Pushed by vkrause into branch 'master'.
Remove the minitools plugin Summary: This depends on KHTML-only API for executing JavaScript in the site context. This concludes the removal of KHTML-only plugins. Reviewers: dfaure, stefanocrocco Reviewed By: dfaure Subscribers: kde-doc-english Tags: #documentation Differential Revision: https://phabricator.kde.org/D24027 M +1 -18 doc/konqueror/index.docbook M +0 -1 konqueror.categories M +0 -1 plugins/CMakeLists.txt M +0 -10 plugins/README D +0 -26 plugins/minitools/CMakeLists.txt D +0 -3 plugins/minitools/Messages.sh D +0 -169 plugins/minitools/minitoolsplugin.cpp D +0 -134 plugins/minitools/minitoolsplugin.desktop D +0 -66 plugins/minitools/minitoolsplugin.h D +0 -11 plugins/minitools/minitoolsplugin.rc https://commits.kde.org/konqueror/6bbbd0c313ba7689153d622558f81e5f0c12de5c diff --git a/doc/konqueror/index.docbook b/doc/konqueror/index.docbook index 27323e34a..fc9e20840 100644 --- a/doc/konqueror/index.docbook +++ b/doc/konqueror/index.docbook @@ -2243,7 +2243,7 @@ are listed in the dialog.</para> <title>Browser Mode</title> <!-- FIXME 16.12 -KHTML: Auto Refresh, HTML Settings, Minitools-Bookmarklets, Translate (disabled), Document Relations, Search Bar +KHTML: Auto Refresh, HTML Settings, Translate (disabled), Document Relations, Search Bar kwebkitpart for kf5 in extragear/base in branch frameworks WebKit only HTML Settings and Translate (disabled) WebEngine -> no extensions @@ -2384,23 +2384,6 @@ and should be very nice for people using Kiosk mode </para></listitem> </varlistentry> -<varlistentry> -<term>Minitools (KHTML view only)</term> -<listitem><para> -This plugin adds implementation for so-called bookmarklets. Bookmarklets are little -Javascript programs which can be saved and used like normal web page bookmarks. Therefore, -they are simple <quote>one-click</quote> tools that can add substantial functionality to the browser. -<!--http://blog.ssokolow.com/archives/2007/01/30/konqueror-with-bookmarklets/--> -</para></listitem> -</varlistentry> - -<varlistentry> -<term>Document Relations (KHTML view only)</term> -<listitem><para> -Displays the document relations of a document -</para></listitem> -</varlistentry> - </variablelist> <variablelist> diff --git a/konqueror.categories b/konqueror.categories index 6ae0d8012..679212935 100644 --- a/konqueror.categories +++ b/konqueror.categories @@ -1,3 +1,2 @@ org.kde.webenginepart webenginepart IDENTIFIER [WEBENGINEPART_LOG] org.kde.konqueror konqueror IDENTIFIER [KONQUEROR_LOG] -org.kde.konqueror.minitools minitools (konqueror plugin) IDENTIFIER [MINITOOLSPLUGIN_LOG] diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 18e83ed5a..8b81c995a 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -18,7 +18,6 @@ if(UNIX) endif(UNIX) # TODO add_subdirectory( imagerotation ) -add_subdirectory( minitools ) add_subdirectory( autorefresh ) if(UNIX) add_subdirectory( fsview ) diff --git a/plugins/README b/plugins/README index 0a9f105e2..280cd0111 100644 --- a/plugins/README +++ b/plugins/README @@ -13,11 +13,6 @@ dirfilter This works on dolphin part. This allows you to filter the current directory in a variety of ways. -validators -------------------- -This works on KHTMLPart/KWebKitPart. It uses the w3c HTML validator to validate -the current page or stylesheet. This is very handy when creating web pages. - khtmlsettingsplugin ------------------- This works on KHTMLPart. This allows you to enable or disable a bunch @@ -48,8 +43,3 @@ akregator ------------------- This works on KHTMLPart/KWebKitPart and allows you to add feeds to Akregator directly from Konqueror. -minitools -------------------- -This plugin adds implementation for so-called bookmarklets. Bookmarklets are little -Javascript programs which can be saved and used like normal web page bookmarks. Therefore, -they are simple "one-click" tools that can add substantial functionality to the browser. diff --git a/plugins/minitools/CMakeLists.txt b/plugins/minitools/CMakeLists.txt deleted file mode 100644 index d3eb94317..000000000 --- a/plugins/minitools/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ - - - - -########### next target ############### -add_definitions(-DTRANSLATION_DOMAIN=\"minitoolsplugin\") - -find_package(KF5 REQUIRED KHtml) - -set(minitoolsplugin_PART_SRCS minitoolsplugin.cpp ) - -ecm_qt_declare_logging_category(minitoolsplugin_PART_SRCS HEADER minitoolsplugindebug.h IDENTIFIER MINITOOLSPLUGIN_LOG CATEGORY_NAME org.kde.konqueror.minitools) - -add_library(minitoolsplugin MODULE ${minitoolsplugin_PART_SRCS}) - - - -target_link_libraries(minitoolsplugin KF5::KHtml KF5::KDELibs4Support) - -install(TARGETS minitoolsplugin DESTINATION ${KDE_INSTALL_PLUGINDIR} ) - - -########### install files ############### - -install( FILES minitoolsplugin.rc minitoolsplugin.desktop DESTINATION ${KDE_INSTALL_DATADIR}/khtml/kpartplugins ) - diff --git a/plugins/minitools/Messages.sh b/plugins/minitools/Messages.sh deleted file mode 100644 index 82af80f34..000000000 --- a/plugins/minitools/Messages.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/sh -$EXTRACTRC *.rc >> rc.cpp -$XGETTEXT *.cpp -o $podir/minitoolsplugin.pot diff --git a/plugins/minitools/minitoolsplugin.cpp b/plugins/minitools/minitoolsplugin.cpp deleted file mode 100644 index 94db6e790..000000000 --- a/plugins/minitools/minitoolsplugin.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - Copyright (c) 2003 Alexander Kellett <[email protected]> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License (LGPL) as published by the Free Software Foundation; - either version 2 of the License, or (at your option) any later - version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "minitoolsplugin.h" -#include "minitoolsplugindebug.h" - -#include <QFile> - -#include <kglobal.h> -#include <kconfig.h> -#include <kcomponentdata.h> -#include <khtml_part.h> -#include <kpluginfactory.h> - -#include <kstandarddirs.h> - -#include <kservice.h> -#include <kactionmenu.h> -#include <QMenu> -#include <kbookmarkimporter.h> -#include <kbookmarkmanager.h> -#include <kactioncollection.h> - -K_PLUGIN_FACTORY(MinitoolsPluginFactory, registerPlugin<MinitoolsPlugin>();) - -MinitoolsPlugin::MinitoolsPlugin(QObject *parent, const QVariantList &) - : KParts::Plugin(parent) -{ - m_part = (parent && parent->inherits("KHTMLPart")) ? static_cast<KHTMLPart *>(parent) : nullptr; - - m_pMinitoolsMenu = new KActionMenu(QIcon::fromTheme(QStringLiteral("minitools")), i18n("&Minitools"), actionCollection()); - actionCollection()->addAction(QStringLiteral("minitools"), m_pMinitoolsMenu); - - m_pMinitoolsMenu->setDelayed(false); - m_pMinitoolsMenu->setEnabled(true); - - connect(m_pMinitoolsMenu->menu(), SIGNAL(aboutToShow()), - this, SLOT(slotAboutToShow())); -} - -MinitoolsPlugin::~MinitoolsPlugin() -{ - ; -} - -void MinitoolsPlugin::slotAboutToShow() -{ - - m_minitoolsList.clear(); - KXBELBookmarkImporterImpl importer; - connect(&importer, SIGNAL(newBookmark(QString,QString,QString)), - SLOT(newBookmarkCallback(QString,QString,QString))); - connect(&importer, SIGNAL(endFolder()), - SLOT(endFolderCallback())); - QString filename = minitoolsFilename(true); - if (!filename.isEmpty() && QFile::exists(filename)) { - importer.setFilename(filename); - importer.parse(); - } - filename = minitoolsFilename(false); - if (!filename.isEmpty() && QFile::exists(filename)) { - importer.setFilename(filename); - importer.parse(); - } - - m_pMinitoolsMenu->menu()->clear(); - - int count = m_pMinitoolsMenu->menu()->actions().count(); // why not 0??? - bool gotSep = true; // don't start with a sep - - if (m_minitoolsList.count() > 0) { - MinitoolsList::ConstIterator e = m_minitoolsList.constBegin(); - for (; e != m_minitoolsList.constEnd(); ++e) { - if (((*e).first == QLatin1String("-")) - && ((*e).second == QLatin1String("-")) - ) { - if (!gotSep) { - m_pMinitoolsMenu->menu()->addSeparator(); - } - gotSep = true; - count++; - } else { - QString str = (*e).first; - // emsquieezzy thingy? - if (str.length() > 48) { - str.truncate(48); - str.append("..."); - } - QAction *action = m_pMinitoolsMenu->menu()->addAction( - str, this, - SLOT(slotItemSelected())); - action->setData(qVariantFromValue(++count)); - gotSep = false; - } - } - } - - if (!gotSep) { - // don't have an extra sep - m_pMinitoolsMenu->menu()->addSeparator(); - } - - m_pMinitoolsMenu->menu() - ->addAction(i18n("&Edit Minitools"), - this, SLOT(slotEditBookmarks())); -} - -void MinitoolsPlugin::newBookmarkCallback( - const QString &text, const QString &url, const QString & -) -{ - qCDebug(MINITOOLSPLUGIN_LOG) << "MinitoolsPlugin::newBookmarkCallback" << text << url; - m_minitoolsList.prepend(qMakePair(text, url)); -} - -void MinitoolsPlugin::endFolderCallback() -{ - qCDebug(MINITOOLSPLUGIN_LOG) << "MinitoolsPlugin::endFolderCallback"; - m_minitoolsList.prepend(qMakePair(QStringLiteral("-"), QStringLiteral("-"))); -} - -QString MinitoolsPlugin::minitoolsFilename(bool local) -{ - return local ? KStandardDirs::locateLocal("data", QStringLiteral("konqueror/minitools.xml")) - : KStandardDirs::locateLocal("data", QStringLiteral("konqueror/minitools-global.xml")); -} - -void MinitoolsPlugin::slotEditBookmarks() -{ - KBookmarkManager *manager = KBookmarkManager::managerForFile(minitoolsFilename(true), QStringLiteral("minitools")); - manager->slotEditBookmarks(); -} - -void MinitoolsPlugin::slotItemSelected() -{ - bool ok = false; - int id = sender() ? qobject_cast<QAction *>(sender())->data().toInt(&ok) : 0; - if (!ok) { - return; - } - if (m_minitoolsList.count() == 0) { - return; - } - QString tmp = m_minitoolsList[id - 1].second; - QString script = QUrl::fromPercentEncoding(tmp.right(tmp.length() - 11).toLatin1()); // sizeof("javascript:") - connect(this, SIGNAL(executeScript(QString)), - m_part, SLOT(executeScript(QString))); - emit executeScript(script); - disconnect(this, SIGNAL(executeScript(QString)), nullptr, nullptr); -} - -#include "minitoolsplugin.moc" diff --git a/plugins/minitools/minitoolsplugin.desktop b/plugins/minitools/minitoolsplugin.desktop deleted file mode 100644 index 713dcc715..000000000 --- a/plugins/minitools/minitoolsplugin.desktop +++ /dev/null @@ -1,134 +0,0 @@ -[Desktop Entry] -X-KDE-Library=Minitools -X-KDE-PluginInfo-Author=Alexander Kellett [email protected] -X-KDE-PluginInfo-Name=Minitools -X-KDE-PluginInfo-Version=3.3 -X-KDE-PluginInfo-Website= -X-KDE-PluginInfo-Category=Tools -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true -Icon=preferences-plugin -Name=Bookmarklets -Name[ar]=العلامات المصغرة -Name[ast]=Bookmarklets -Name[bg]=Бързи отметки -Name[bs]=Obeleživačići -Name[ca]=Bookmarklets -Name[ca@valencia]=Bookmarklets -Name[cs]=Záložky -Name[da]=Bookmarklets -Name[de]=Lesezeichenskripte -Name[el]=Bookmarklets -Name[en_GB]=Bookmarklets -Name[es]=Marcadores de JavaScript -Name[et]=Funktsionaaljärjehoidjad -Name[eu]=JS-Laster-markak -Name[fi]=Toimintokirjanmerkki -Name[fr]=Signets avec scripts -Name[ga]=Leabharmhaircíní -Name[gl]=Marcadores -Name[he]=סימניות -Name[hne]=बुकमार्कलेट्स -Name[hu]=Könyvjelzők -Name[ia]=Bookmarklets -Name[id]=Bookmarklets -Name[is]=Bókamerkjaskriftur -Name[it]=Bookmarklet -Name[ja]=ブックマークレット -Name[kk]=Бетбелгішелері -Name[km]=Bookmarklet -Name[ko]=북마클릿 -Name[ku]=Cih-Nîşanker -Name[lt]=Išmanios žymelės -Name[lv]=Grāmatzīmju sīkrīki -Name[mr]=ओळखचिन्ह -Name[nb]=Småbokmerker -Name[nds]=Skript-Leestekens -Name[nl]=Bladwijzers -Name[nn]=Bokmerkeprogram -Name[pa]=ਬੁੱਕਮਾਰਕਲਿਟਸ -Name[pl]=Zakładki -Name[pt]=Mini-favoritos -Name[pt_BR]=Minifavoritos -Name[ro]=Bookmarklet-uri -Name[ru]=Закладки -Name[sk]=Bookmarklets (favelet) -Name[sl]=Skripti v zaznamkih -Name[sr]=Обележивачићи -Name[sr@ijekavian]=Обиљеживачићи -Name[sr@ijekavianlatin]=Obilježivačići -Name[sr@latin]=Obeleživačići -Name[sv]=Småbokmärken -Name[tg]=Хатчӯбҳо -Name[th]=คั่นหน้าต่าง ๆ -Name[tr]=Yer İmleyicileri -Name[ug]=خەتكۈچلەر -Name[uk]=Дієзакладки -Name[wa]=Pititès rmarkes -Name[x-test]=xxBookmarkletsxx -Name[zh_CN]=书签 -Name[zh_TW]=書籤 -Comment=Enables the use of bookmarklets -Comment[ar]=تمكن استعمال العلامات المصغرة -Comment[ast]=Activa l'usu de bookmarklets -Comment[bg]=Използване на бързи отметки (bookmarklets) -Comment[bs]=Uključuje obeleživačiće -Comment[ca]=Habilita l'ús de «bookmarklets» -Comment[ca@valencia]=Habilita l'ús de «bookmarklets» -Comment[cs]=Povolení záložek -Comment[da]=Aktiverer brugen af bookmarklets -Comment[de]=Ermöglicht die Verwendung von Lesezeichenskripten -Comment[el]=Ενεργοποιεί τη χρήση bookmarklets -Comment[en_GB]=Enables the use of bookmarklets -Comment[es]=Activa el uso de marcadores de JavaScript -Comment[et]=Lülitab sisse funktsionaaljärjehoidjate kasutamise -Comment[eu]=JS-laster-marken erabiltzea gaitzen du -Comment[fi]=Ottaa toimintokirjanmerkit käyttöön -Comment[fr]=Active l'utilisation de signets avec scripts -Comment[ga]=Cumasaigh leabharmhaircíní -Comment[gl]=Activa o uso de marcadores -Comment[he]=אפשר שימוש בסימניות -Comment[hne]=बुकमार्कलेट मन के उपयोग सक्छम करथे -Comment[hu]=Könyvjelzők használatának engedélyezése -Comment[ia]=Habilita le uso de bookmarklets -Comment[id]=Fungsikan penggunaan bookmarklets -Comment[is]=Virkjar notkun bókamerkjaskrifta (bookmarklets) -Comment[it]=Permette l'uso dei bookmarklet -Comment[ja]=ブックマークレットを使えるようにします -Comment[kk]=Бетбелгішелерін рұқсат етеді -Comment[km]=អនុញ្ញាតការប្រើ bookmarklet -Comment[ko]=북마클릿 활성화시키기 -Comment[ku]=Bikaranîna cih-nîşankeran çalak dike -Comment[lt]=Įjungia išmanių žymelių naudojimą -Comment[lv]=Lauj jums izmantot grāmatzīmju sīkrīkus -Comment[mr]=ओळखचिन्हाचा वापर कार्यान्वित करतो -Comment[nb]=Slår på bruk av småbokmerker -Comment[nds]=Verlöövt dat Bruken vun Skript-Leestekens -Comment[nl]=Activeert het gebruik van bladwijzers -Comment[nn]=Slår på bruk av bokmerkeprogram -Comment[pa]=ਬੁੱਕਮਾਰਕਲਿਟਸ ਦੀ ਵਰਤੋਂ ਯੋਗ ਕਰੋ -Comment[pl]=Umożliwia użycie zakładek -Comment[pt]=Activa o uso de mini-favoritos -Comment[pt_BR]=Habilita o uso de minifavoritos -Comment[ro]=Activează folosirea de bookmarklet-uri -Comment[ru]=Включает использование закладок -Comment[sk]=Umožňuje použitie bookmarklets (favelet) -Comment[sl]=Omogoči uporabo skriptov v zaznamkih -Comment[sr]=Укључује обележивачиће -Comment[sr@ijekavian]=Укључује обиљеживачиће -Comment[sr@ijekavianlatin]=Uključuje obilježivačiće -Comment[sr@latin]=Uključuje obeleživačiće -Comment[sv]=Aktiverar användning av småbokmärken -Comment[tg]=Истифодабарии хатчӯбҳоро фаъол мекунад -Comment[th]=เปิดให้ใช้งานคั่นหน้าต่าง ๆ -Comment[tr]=Yer imleyicilerin kullanımını sağlar -Comment[ug]=خەتكۈچلەرنى ئىشلىتىشنى قوزغىتىدۇ -Comment[uk]=Вмикає використання дієзакладок -Comment[wa]=Permete l' eployaedje di ptitès rmarkes -Comment[x-test]=xxEnables the use of bookmarkletsxx -Comment[zh_CN]=启用书签的使用 -Comment[zh_TW]=開啟使用書籤 -X-KDE-ParentApp=konqueror -DocPath=konq-plugins/minitools/index.html diff --git a/plugins/minitools/minitoolsplugin.h b/plugins/minitools/minitoolsplugin.h deleted file mode 100644 index d480e9252..000000000 --- a/plugins/minitools/minitoolsplugin.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (c) 2003 Alexander Kellett <[email protected]> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License (LGPL) as published by the Free Software Foundation; - either version 2 of the License, or (at your option) any later - version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __MINITOOLS_PLUGIN_H -#define __MINITOOLS_PLUGIN_H - -#include <qmap.h> -#include <QList> -#include <qstringlist.h> - -#include <klibloader.h> -#include <kparts/plugin.h> - -class KHTMLPart; -class KActionMenu; - -class MinitoolsPlugin : public KParts::Plugin -{ - Q_OBJECT - -public: - MinitoolsPlugin(QObject *parent, const QVariantList &); - ~MinitoolsPlugin() override; - -protected slots: - void slotAboutToShow(); - void slotEditBookmarks(); - void slotItemSelected(); - void newBookmarkCallback(const QString &, const QString &, const QString &); - void endFolderCallback(); - -signals: - void executeScript(const QString &script); - -private: - QString minitoolsFilename(bool local); - - int m_selectedItem; - - KHTMLPart *m_part; - KActionMenu *m_pMinitoolsMenu; - - typedef QPair<QString, QString> Minitool; - typedef QList<Minitool> MinitoolsList; - - MinitoolsList m_minitoolsList; -}; - -#endif diff --git a/plugins/minitools/minitoolsplugin.rc b/plugins/minitools/minitoolsplugin.rc deleted file mode 100644 index 9e495333c..000000000 --- a/plugins/minitools/minitoolsplugin.rc +++ /dev/null @@ -1,11 +0,0 @@ -<!DOCTYPE gui> -<gui name="Minitools" library="minitoolsplugin" translationDomain="minitoolsplugin"> -<MenuBar> - <Menu name="tools"><Text>&Tools</Text> - <Action name="minitools"/> - </Menu> -</MenuBar> -<ToolBar name="extraToolBar"><text>Extra Toolbar</text> - <Action name="minitools"/> -</ToolBar> -</gui>
