summaryrefslogtreecommitdiffstats
path: root/konq-plugins/sidebar/metabar/src/metabar.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch)
tree2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /konq-plugins/sidebar/metabar/src/metabar.cpp
downloadtdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz
tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/sidebar/metabar/src/metabar.cpp')
-rw-r--r--konq-plugins/sidebar/metabar/src/metabar.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/konq-plugins/sidebar/metabar/src/metabar.cpp b/konq-plugins/sidebar/metabar/src/metabar.cpp
new file mode 100644
index 0000000..8181a11
--- /dev/null
+++ b/konq-plugins/sidebar/metabar/src/metabar.cpp
@@ -0,0 +1,59 @@
+#include <kinstance.h>
+#include <qstring.h>
+#include <kimageio.h>
+#include <klocale.h>
+
+#include "metabarwidget.h"
+#include "metabar.h"
+#include "metabar.moc"
+
+Metabar::Metabar(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name):
+ KonqSidebarPlugin(inst,parent,widgetParent,desktopName,name)
+{
+ KImageIO::registerFormats();
+ KGlobal::locale()->insertCatalogue( "konqsidebar_metabar" );
+
+ widget = new MetabarWidget(widgetParent, "metabarwidget");
+}
+
+
+Metabar::~Metabar()
+{
+}
+
+void Metabar::handleURL(const KURL &url)
+{
+ const KFileItem *item = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, url, true);
+ KFileItemList list;
+ list.append(item);
+
+ widget->setFileItems(list);
+}
+
+void Metabar::handlePreview(const KFileItemList &items)
+{
+ widget->setFileItems(items);
+}
+
+
+extern "C" {
+ bool add_konqsidebar_metabar(QString* fn, QString* param, QMap<QString,QString> *map) {
+ Q_UNUSED(param);
+
+ map->insert("Type", "Link");
+ map->insert("Icon", "metabar");
+ map->insert("Name", "Metabar");
+ map->insert("Open", "true");
+ map->insert("X-KDE-KonqSidebarModule","konqsidebar_metabar");
+ fn->setLatin1("metabar%1.desktop");
+ return true;
+ }
+}
+
+extern "C"
+{
+ void* create_konqsidebar_metabar(KInstance *instance,QObject *par,QWidget *widp,QString &desktopname,const char *name)
+ {
+ return new Metabar(instance,par,widp,desktopname,name);
+ }
+}