[network/kio-extras] /: Remove bookmarks worker
Nicolas Fella
null at kde.org
Wed Aug 9 13:59:05 BST 2023
Git commit 1a98236939072fd3143262e74c528baf0e521d67 by Nicolas Fella.
Committed on 09/08/2023 at 14:36.
Pushed by nicolasfella into branch 'master'.
Remove bookmarks worker
It is moved to Konqueror since it's not useful outside of it
M +0 -2 CMakeLists.txt
D +0 -20 bookmarks/CMakeLists.txt
D +0 -2 bookmarks/Messages.sh
D +0 -13 bookmarks/bookmarks.json
D +0 -226 bookmarks/kio_bookmarks.cpp
D +0 -105 bookmarks/kio_bookmarks.css
D +0 -52 bookmarks/kio_bookmarks.h
D +0 -202 bookmarks/kio_bookmarks_html.cpp
D +0 -65 bookmarks/kio_bookmarks_pixmap.cpp
M +0 -1 doc/kioslave/CMakeLists.txt
D +0 -2 doc/kioslave/bookmarks/CMakeLists.txt
D +0 -29 doc/kioslave/bookmarks/index.docbook
https://invent.kde.org/network/kio-extras/-/commit/1a98236939072fd3143262e74c528baf0e521d67
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e77ac33b1..eb5fe2eb6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,7 +56,6 @@ find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS
I18n
KIO
Solid
- Bookmarks
GuiAddons
SyntaxHighlighting
)
@@ -179,7 +178,6 @@ endif()
if(KF${QT_MAJOR_VERSION}ActivitiesStats_FOUND)
add_subdirectory( recentlyused )
endif()
-add_subdirectory( bookmarks )
add_subdirectory( filter )
if(Phonon4Qt${QT_MAJOR_VERSION}_FOUND)
add_subdirectory( kfileaudiopreview )
diff --git a/bookmarks/CMakeLists.txt b/bookmarks/CMakeLists.txt
deleted file mode 100644
index 3f5df010c..000000000
--- a/bookmarks/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-add_definitions(-DTRANSLATION_DOMAIN=\"kio5_bookmarks\")
-
-remove_definitions(-DQT_NO_CAST_FROM_ASCII)
-
-add_library(kio_bookmarks MODULE)
-set_target_properties(kio_bookmarks PROPERTIES
- OUTPUT_NAME "bookmarks"
-)
-
-target_sources(kio_bookmarks PRIVATE
- kio_bookmarks.cpp
- kio_bookmarks_html.cpp
- kio_bookmarks_pixmap.cpp
-)
-
-target_link_libraries(kio_bookmarks KF${QT_MAJOR_VERSION}::ConfigWidgets KF${QT_MAJOR_VERSION}::KIOCore KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::Bookmarks KF${QT_MAJOR_VERSION}::Solid KF${QT_MAJOR_VERSION}::GuiAddons KF${QT_MAJOR_VERSION}::KIOFileWidgets)
-
-install(TARGETS kio_bookmarks DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/kio)
-
-install( FILES kio_bookmarks.css DESTINATION ${KDE_INSTALL_DATADIR}/kio_bookmarks )
diff --git a/bookmarks/Messages.sh b/bookmarks/Messages.sh
deleted file mode 100755
index 53396abb4..000000000
--- a/bookmarks/Messages.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#! /usr/bin/env bash
-$XGETTEXT *.cpp -o $podir/kio5_bookmarks.pot
diff --git a/bookmarks/bookmarks.json b/bookmarks/bookmarks.json
deleted file mode 100644
index 5a4ff599e..000000000
--- a/bookmarks/bookmarks.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "KDE-KIO-Protocols": {
- "bookmarks": {
- "Class": ":local",
- "Icon": "bookmarks",
- "X-DocPath": "kioslave5/bookmarks/index.html",
- "input": "none",
- "output": "stream",
- "protocol": "bookmarks",
- "reading": true
- }
- }
-}
diff --git a/bookmarks/kio_bookmarks.cpp b/bookmarks/kio_bookmarks.cpp
deleted file mode 100644
index fbf8d5c3b..000000000
--- a/bookmarks/kio_bookmarks.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- SPDX-FileCopyrightText: 2008 Xavier Vello <xavier.vello at gmail.com>
-
- SPDX-License-Identifier: GPL-2.0-or-later
-
-*/
-
-#include "kio_bookmarks.h"
-
-#include <KShell>
-#include <KLocalizedString>
-#include <KConfigGroup>
-#include <KBookmark>
-#include <KImageCache>
-#include <KFilePlacesModel>
-#include <Solid/Device>
-#include <Solid/DeviceInterface>
-#include <KIO/ApplicationLauncherJob>
-
-#include <QDebug>
-#include <QGuiApplication>
-#include <QRegularExpression>
-#include <QTextDocument>
-#include <QUrlQuery>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-using namespace KIO;
-
-// Pseudo plugin class to embed meta data
-class KIOPluginForMetaData : public QObject
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.kde.kio.worker.bookmarks" FILE "bookmarks.json")
-};
-
-BookmarksProtocol::BookmarksProtocol( const QByteArray &pool, const QByteArray &app )
- : WorkerBase( "bookmarks", pool, app )
-{
- manager = KBookmarkManager::userBookmarksManager();
- cfg = new KConfig( "kiobookmarksrc" );
- config = cfg->group("General");
- cache = new KImageCache("kio_bookmarks", config.readEntry("CacheSize", 5 * 1024) * 1024);
- cache->setPixmapCaching(false);
-
- indent = 0;
- totalsize = 0;
- columns = 4;
-}
-
-BookmarksProtocol::~BookmarksProtocol()
-{
- delete manager;
- delete cache;
- delete cfg;
-}
-
-void BookmarksProtocol::parseTree()
-{
- totalsize = 0;
-
- cfg->reparseConfiguration();
- columns = config.readEntry("Columns", 4);
- if (columns < 1)
- columns = 1;
-
- manager->notifyCompleteChange("kio_bookmarks");
- tree = manager->root();
-
- if(tree.first().isNull())
- return;
-
- if(config.readEntry("FlattenTree", false))
- flattenTree(tree);
-
- KBookmarkGroup root;
- if(config.readEntry("ShowRoot", true))
- {
- root = tree.createNewFolder(i18n("Root"));
- tree.moveBookmark(root, KBookmark());
- root.setIcon("konqueror");
- }
-
- KBookmark bm = tree.first();
- KBookmark next;
- while(!bm.isNull())
- {
- next = tree.next(bm);
- if (bm.isSeparator())
- tree.deleteBookmark(bm);
- else if (bm.isGroup())
- totalsize += sizeOfGroup(bm.toGroup());
- else
- {
- if(config.readEntry("ShowRoot", true))
- root.addBookmark(bm);
-
- tree.deleteBookmark(bm);
- }
- bm = next;
- }
- if(config.readEntry("ShowRoot", true))
- totalsize += sizeOfGroup(root);
-
- if(config.readEntry("ShowPlaces", true))
- totalsize += addPlaces();
-}
-
-int BookmarksProtocol::addPlaces()
-{
- KFilePlacesModel placesModel;
- KBookmarkGroup folder = tree.createNewFolder(i18n("Places"));
- QList<Solid::Device> batteryList = Solid::Device::listFromType(Solid::DeviceInterface::Battery, QString());
-
- if (batteryList.isEmpty()) {
- folder.setIcon("computer");
- } else {
- folder.setIcon("computer-laptop");
- }
-
- for (int row = 0; row < placesModel.rowCount(); ++row) {
- QModelIndex index = placesModel.index(row, 0);
-
- if (!placesModel.isHidden(index))
- folder.addBookmark(placesModel.bookmarkForIndex(index));
- }
- return sizeOfGroup(folder);
-}
-
-void BookmarksProtocol::flattenTree( const KBookmarkGroup &folder )
-{
- KBookmark bm = folder.first();
- KBookmark prev = folder;
- KBookmark next;
- while (!bm.isNull())
- {
- if (bm.isGroup()) {
- flattenTree(bm.toGroup());
- }
-
- next = tree.next(bm);
-
- if (bm.isGroup() && bm.parentGroup().hasParent()) {
- bm.setFullText("| " + bm.parentGroup().fullText() + " > " + bm.fullText());
- tree.moveBookmark(bm, prev);
- prev = bm;
- }
- bm = next;
- }
-}
-
-// Should really go to KBookmarkGroup
-int BookmarksProtocol::sizeOfGroup( const KBookmarkGroup &folder, bool real )
-{
- int size = 1; // counting the title line
- for (KBookmark bm = folder.first(); !bm.isNull(); bm = folder.next(bm))
- {
- if (bm.isGroup())
- size += sizeOfGroup(bm.toGroup());
- else
- size += 1;
- }
-
- // CSS sets a min-height for toplevel folders
- if (folder.parentGroup() == tree && size < 8 && real == false)
- size = 8;
-
- return size;
-}
-
-KIO::WorkerResult BookmarksProtocol::get( const QUrl& url )
-{
- QString path = url.path();
- const QRegularExpression regexp(QStringLiteral("^/(background|icon)/([\\S]+)"));
- QRegularExpressionMatch rmatch;
-
- if (path.isEmpty() || path == "/") {
- echoIndex();
- } else if (path == "/config") {
- // TODO: seems service bookmarks.desktop is gone?
- const KService::Ptr bookmarksKCM = KService::serviceByDesktopName(QStringLiteral("bookmarks"));
- if (bookmarksKCM) {
- auto job = new KIO::ApplicationLauncherJob(bookmarksKCM);
- job->start();
- }
- echoHead("bookmarks:/");
- if (!bookmarksKCM) {
- return KIO::WorkerResult::fail(KIO::ERR_WORKER_DEFINED, i18n("Could not find bookmarks config"));
- }
- } else if (path == "/editbookmarks") {
- const KService::Ptr keditbookmarks = KService::serviceByDesktopName(QStringLiteral("org.kde.keditbookmarks.nope"));
- if (keditbookmarks) {
- auto job = new KIO::ApplicationLauncherJob(keditbookmarks);
- job->start();
- }
- echoHead("bookmarks:/");
- if (!keditbookmarks) {
- return KIO::WorkerResult::fail(KIO::ERR_WORKER_DEFINED, i18n("Could not find bookmarks editor"));
- }
- } else if (path.indexOf(regexp, 0, &rmatch) >= 0) {
- echoImage(rmatch.captured(1), rmatch.captured(2), QUrlQuery(url).queryItemValue("size"));
- } else {
- echoHead();
- echo("<p class=\"message\">" + i18n("Wrong request: %1", url.toDisplayString().toHtmlEscaped()) + "</p>");
- }
- return KIO::WorkerResult::pass();;
-}
-
-extern "C" int Q_DECL_EXPORT kdemain(int argc, char **argv)
-{
- QGuiApplication app(argc, argv);
- app.setApplicationName(QLatin1String("kio_bookmarks"));
-
- if (argc != 4) {
- qCritical() << "Usage: kio_bookmarks protocol domain-socket1 domain-socket2";
- exit(-1);
- }
-
- BookmarksProtocol worker(argv[2], argv[3]);
- worker.dispatchLoop();
-
- return 0;
-}
-
-#include "kio_bookmarks.moc"
diff --git a/bookmarks/kio_bookmarks.css b/bookmarks/kio_bookmarks.css
deleted file mode 100644
index 935e1d2af..000000000
--- a/bookmarks/kio_bookmarks.css
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-SPDX-FileCopyrightText: 2008 Xavier Vello <xavier.vello at gmail.com>
-
-SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-body {
- margin: 0 42px;
- font-size: small;
- font-family: "sans-serif";
- line-height: 16px;
- text-align: center;
- white-space: nowrap;
-}
-
-div.column {
- display: inline-block;
- vertical-align: top;
- width: 25%;
- max-width: 300px;
- min-width: 150px;
- padding-top: 5px;
- text-align: left;
-}
-
-ul li {
- list-style: none;
- white-space: normal;
- margin: 0;
- padding: 0;
-}
-
-div.column > ul {
- margin: 5px 5px 10px 5px;
- padding: 0 5px 5px 5px;
- min-height: 150px;
- background: no-repeat 90% 95%;
-}
-
-div.column > ul > li.title {
- text-align: center;
- font-weight: bold;
- font-size: 100%;
- margin: 2px -6px 5px -6px;
- border-bottom: 1px solid #AAA;
-}
-
-li.link {
- padding: 2px 5px 2px 20px;
- margin-bottom: 0px;
-}
-
-ul ul {
- margin-bottom: 5px;
- border-left: 1px solid #AAA;
- margin-left: 8px;
- padding-left: 5px;
-}
-
-ul ul li.title {
- padding: 0px 5px 2px 20px;
- margin-left: -13px;
- margin-bottom: 6px;
- border-bottom: 1px solid #AAA;
- height: 10px;
-}
-
-li img {
- float: left;
- margin-left: -20px;
-}
-
-a, a:hover a:visited {
- text-decoration: none;
- color: inherit;
-}
-
-hr {
- width: 66%;
- margin: 7px auto 7px auto;
- background-color: #AAA;
- border: none;
- height: 1px;
-}
-
-p.message {
- text-align: center;
- margin: auto;
- width: 50%;
- margin-top: 2em;
- padding: 2em;
-}
-
-div.toolbar {
- position: fixed;
- right: 0;
- top: 0;
- padding: 2px 0;
-}
-
-div.toolbar img {
- display: block;
- padding: 2px 5px;
- margin: 0;
-}
diff --git a/bookmarks/kio_bookmarks.h b/bookmarks/kio_bookmarks.h
deleted file mode 100644
index ad55e4a70..000000000
--- a/bookmarks/kio_bookmarks.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- SPDX-FileCopyrightText: 2008 Xavier Vello <xavier.vello at gmail.com>
-
- SPDX-License-Identifier: GPL-2.0-or-later
-*/
-#ifndef KIO_BOOKMARKS_H
-#define KIO_BOOKMARKS_H
-
-#include <KIO/WorkerBase>
-#include <KBookmarkManager>
-#include <KConfig>
-#include <KConfigGroup>
-#include <KImageCache>
-
-class BookmarksProtocol : public KIO::WorkerBase
-{
-public:
- BookmarksProtocol( const QByteArray &pool, const QByteArray &app );
- ~BookmarksProtocol() override;
-
- KIO::WorkerResult get( const QUrl& url ) override;
-
-private:
- int columns;
- int indent;
- int totalsize;
- KSharedPixmapCacheMixin< KSharedDataCache >* cache;
- KBookmarkManager* manager;
- KConfig* cfg;
- KConfigGroup config;
- KBookmarkGroup tree;
- void parseTree();
- void flattenTree( const KBookmarkGroup &folder );
- int sizeOfGroup(const KBookmarkGroup &folder, bool real = false);
- int addPlaces();
-
- // Defined in kde_bookmarks_html.cpp
- void echo( const QString &string );
- QString htmlColor(const QColor &col);
- QString htmlColor(const QBrush &brush);
- void echoIndex();
- void echoHead(const QString &redirect = QString());
- void echoStyle();
- void echoBookmark( const KBookmark &bm);
- void echoSeparator();
- void echoFolder( const KBookmarkGroup &folder );
-
- // Defined in kde_bookmarks_pixmap.cpp
- void echoImage( const QString &type, const QString &string, const QString &sizestring = QString());
-};
-
-#endif
diff --git a/bookmarks/kio_bookmarks_html.cpp b/bookmarks/kio_bookmarks_html.cpp
deleted file mode 100644
index b5f0575bc..000000000
--- a/bookmarks/kio_bookmarks_html.cpp
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
-SPDX-FileCopyrightText: 2008 Xavier Vello <xavier.vello at gmail.com>
-
-SPDX-License-Identifier: GPL-2.0-or-later
-*/
-
-#include "kio_bookmarks.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <KShell>
-#include <KLocalizedString>
-#include <KConfig>
-#include <KConfigGroup>
-#include <KBookmark>
-#include <KBookmarkManager>
-#include <KColorScheme>
-#include <KColorUtils>
-
-#include <QStandardPaths>
-#include <QFontDatabase>
-
-void BookmarksProtocol::echoBookmark( const KBookmark &bm)
-{
- QString descriptionAsTitle = bm.description().toHtmlEscaped();
- if (!descriptionAsTitle.isEmpty())
- descriptionAsTitle.prepend(QLatin1String("\" title=\""));
- echo ("<li class=\"link\"><a href=\"" + bm.url().url() + descriptionAsTitle + "\"><img src=\"/icon/" + bm.icon() + "\"/>" + bm.text().toHtmlEscaped() + "</a></li>");
-}
-
-void BookmarksProtocol::echoSeparator()
-{
- echo ("<hr/>");
-}
-
-void BookmarksProtocol::echoFolder( const KBookmarkGroup &folder )
-{
- if (sizeOfGroup(folder.toGroup(), true) > 1)
- {
- QString descriptionAsTitle = folder.description();
- if (!descriptionAsTitle.isEmpty())
- descriptionAsTitle.prepend(QLatin1String("\" title=\""));
-
- if (folder.parentGroup() == tree)
- {
- if (config.readEntry("ShowBackgrounds", true))
- echo("<ul style=\"background-image: url(/background/" + folder.icon() + ")\">");
- else
- echo("<ul>");
-
- echo ("<li class=\"title" + descriptionAsTitle + "\">" + folder.fullText() + "</li>");
- }
- else
- {
- echo("<ul>");
- echo ("<li class=\"title" + descriptionAsTitle + "\"><img src=\"/icon/" + folder.icon() + "\"/>" + folder.text() + "</li>");
- }
- indent++;
-
- for (KBookmark bm = folder.first(); !bm.isNull(); bm = folder.next(bm))
- {
- if (bm.isGroup())
- echoFolder(bm.toGroup());
- else if (bm.isSeparator())
- echoSeparator();
- else
- echoBookmark(bm);
- }
-
- indent--;
- echo("</ul>");
- }
-}
-
-void BookmarksProtocol::echoIndex()
-{
- parseTree();
-
- echoHead();
-
- KBookmark bm = tree.first();
-
- if(bm.isNull()) {
- echo("<p class=\"message\">" + i18n("There are no bookmarks to display yet.") + "</p>");
- }
- else {
- for (int i = 1; i <= columns; i++)
- {
- int size = 0;
- echo("<div class=\"column\">");
- indent++;
-
- while(!bm.isNull() && (size + sizeOfGroup(bm.toGroup())*2/3 < (totalsize / columns) || size == 0))
- {
- echoFolder(bm.toGroup());
- size += sizeOfGroup(bm.toGroup());
- bm = tree.next(bm);
- }
-
- if (i == columns)
- {
- while(!bm.isNull())
- {
- echoFolder(bm.toGroup());
- bm = tree.next(bm);
- }
- }
- indent--;
- echo("</div>");
- }
- }
- indent--;
- echo("</body>");
- echo("</html>");
-}
-
-void BookmarksProtocol::echoHead(const QString &redirect)
-{
- WorkerBase::mimeType("text/html");
-
- QString css(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kio_bookmarks/kio_bookmarks.css"));
- if (css.isEmpty())
- this->warning(i18n("kio_bookmarks CSS file not found. Output will look ugly.\n"
- "Check your installation."));
-
- echo("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>");
- echo("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"");
- echo("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
- echo("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
- echo("<head>");
- indent++;
- echo("<title>" + i18n("My Bookmarks") + "</title>");
- echo("<link rel=\"stylesheet\" type=\"text/css\" href=\"file://" + QString::fromUtf8(css.toUtf8()) + "\" />");
- echoStyle();
-
- if (!redirect.isEmpty())
- echo("<meta http-equiv=\"Refresh\" content=\"0;url=" + redirect + "\"/>");
-
- indent--;
- echo("</head>");
- echo("<body>");
- indent++;
-
- /*echo("<div class=\"toolbar\">");
- indent++;
- echo("<a title=\"" + i18n("Configuration") + "\" href=\"/config\"><img src=\"/icon/preferences-system?size=32\"/></a>");
- echo("<a title=\"" + i18n("Edit bookmarks") + "\" href=\"/editbookmarks\"><img src=\"/icon/bookmarks-organize?size=32\"/></a>");
- echo("<a title=\"" + i18n("Help") + "\" href=\"help:/kioslave/bookmarks.html\"><img src=\"/icon/help-contents?size=32\"/></a>");
- indent--;
- echo("</div>");*/
-
- if (!redirect.isEmpty())
- echo("</body></html>");
-
-}
-
-void BookmarksProtocol::echoStyle()
-{
- KColorScheme window = KColorScheme(QPalette::Active, KColorScheme::Window);
- KColorScheme view = KColorScheme(QPalette::Active, KColorScheme::View);
- KColorScheme selection = KColorScheme(QPalette::Active, KColorScheme::Selection);
-
- QFont font = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
-
- echo("<style type=\"text/css\">");
- indent++;
- echo("li.link:hover, div.toolbar img:hover { background: " +
- htmlColor(KColorUtils::tint(view.background().color(), view.decoration(KColorScheme::HoverColor).color(), 0.4)) + "; }");
- echo("div.column > ul, div.toolbar, p.message { background-color: " + htmlColor(view.background()) + "; " +
- "border: 1px solid " + htmlColor(view.shade(KColorScheme::LightShade)) + "; }");
- echo("div.column > ul:hover, p.message:hover { border: 1px solid " + htmlColor(view.decoration(KColorScheme::HoverColor)) + "; }");
- echo("div.toolbar {border-top: none; border-right: none;}");
- echo("div.column { width : " + QString::number(100/columns) + "%; }");
- echo("body { font-size: " + QString::number(font.pointSize()) + "pt; " +
- "background: " + htmlColor(window.background()) + "; " +
- "color: " + htmlColor(view.foreground()) + "; }");
- indent--;
- echo("</style>");
-}
-
-void BookmarksProtocol::echo( const QString &string )
-{
- for(int i = 0; i < indent; i++)
- {
- data(" ");
- }
- data(string.toUtf8() + '\n');
-}
-
-QString BookmarksProtocol::htmlColor(const QColor &col)
-{
- int r, g, b;
- col.getRgb(&r, &g, &b);
- const QString num = QString::asprintf("#%02X%02X%02X", r, g, b);
- return num;
-}
-
-QString BookmarksProtocol::htmlColor(const QBrush &brush)
-{
- return htmlColor(brush.color());
-}
diff --git a/bookmarks/kio_bookmarks_pixmap.cpp b/bookmarks/kio_bookmarks_pixmap.cpp
deleted file mode 100644
index 6191dee29..000000000
--- a/bookmarks/kio_bookmarks_pixmap.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-SPDX-FileCopyrightText: 2008 Xavier Vello <xavier.vello at gmail.com>
-
-SPDX-License-Identifier: GPL-2.0-or-later
-
-*/
-
-#include "kio_bookmarks.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-
-#include <KImageCache>
-#include <KConfig>
-#include <KConfigGroup>
-
-#include <QBuffer>
-#include <QPainter>
-#include <QPixmap>
-#include <QIcon>
-#include <KImageCache>
-
-using namespace KIO;
-
-void BookmarksProtocol::echoImage( const QString &type, const QString &string, const QString &sizestring )
-{
- int size = sizestring.toInt();
- if (size == 0) {
- if (type == "icon")
- size = 16;
- else
- size = 128;
- }
-
- // Although KImageCache supports caching pixmaps, we need to send the data to the
- // destination process anyways so don't bother, just hold onto the image data.
- QImage image;
- bool ok = cache->findImage(type + string + QString::number(size), &image);
- if (!ok || image.isNull()) {
- const QIcon icon = QIcon::fromTheme(string);
- QPixmap pix; // QIcon can't give us a QImage anyways.
-
- if (type == "icon") {
- pix = icon.pixmap(size, size);
- } else {
- pix = QPixmap(size, size);
- pix.fill(Qt::transparent);
-
- QPainter painter(&pix);
- painter.setOpacity(0.3);
- painter.drawPixmap(pix.rect(), icon.pixmap(size, size), pix.rect());
- }
-
- image = pix.toImage();
- cache->insertImage(type + string + QString::number(size), image);
- }
-
- QBuffer buffer;
- buffer.open(QIODevice::WriteOnly);
- image.save(&buffer, "PNG");
-
- WorkerBase::mimeType("image/png");
- data(buffer.buffer());
-}
diff --git a/doc/kioslave/CMakeLists.txt b/doc/kioslave/CMakeLists.txt
index c34453a91..84d2e36ec 100644
--- a/doc/kioslave/CMakeLists.txt
+++ b/doc/kioslave/CMakeLists.txt
@@ -1,4 +1,3 @@
-add_subdirectory(bookmarks)
if(KArchive_HAVE_BZIP2)
add_subdirectory(bzip2)
endif()
diff --git a/doc/kioslave/bookmarks/CMakeLists.txt b/doc/kioslave/bookmarks/CMakeLists.txt
deleted file mode 100644
index e738cbf6d..000000000
--- a/doc/kioslave/bookmarks/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-########### install files ###############
-kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR kioslave5/bookmarks)
diff --git a/doc/kioslave/bookmarks/index.docbook b/doc/kioslave/bookmarks/index.docbook
deleted file mode 100644
index 7d7fa8f10..000000000
--- a/doc/kioslave/bookmarks/index.docbook
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" ?>
-<!DOCTYPE article PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN"
-"dtd/kdedbx45.dtd" [
-<!ENTITY % addindex "IGNORE">
-<!ENTITY % English "INCLUDE" > <!-- change language only here -->
-]>
-
-<article lang="&language;" id="bookmarks">
-<title>bookmarks</title>
-<articleinfo>
-<authorgroup>
-<author>
-<personname><firstname>Xavier</firstname><surname>Vello</surname></personname>
-<email>xavier.vello at gmail.com</email>
-</author>
-<!-- TRANS:ROLES_OF_TRANSLATORS -->
-</authorgroup>
-
-<date>2008-08-31</date>
-<releaseinfo>0.2</releaseinfo>
-
-</articleinfo>
-
-<para>This <acronym>KIO</acronym> displays your bookmarks as a nice and functional &HTML; page. You access it typing <userinput>bookmarks:/</userinput> in the &konqueror; location bar.</para>
-
-<para>The content and layout of the page is configurable. Just point &konqueror; to <userinput>bookmarks:/config</userinput> to launch the configuration dialog.</para>
-
-</article>
-
More information about the kde-doc-english
mailing list