#include <konq_operations.h>
-#include <kpropertiesdialog.h>
-#include <kglobalsettings.h>
+#include <kaboutdata.h>
#include <kactioncollection.h>
+#include <kconfiggroup.h>
+#include <kdebug.h>
#include <kdirlister.h>
+#include <kglobalsettings.h>
#include <kiconloader.h>
+#include <klocale.h>
#include <kmessagebox.h>
-#include <kparts/genericfactory.h>
+#include <kpluginfactory.h>
+#include <kpropertiesdialog.h>
#include <ktoggleaction.h>
-#include <kconfiggroup.h>
#include <QActionGroup>
#include <QApplication>
#include <QClipboard>
-typedef KParts::GenericFactory<DolphinPart> DolphinPartFactory;
-K_EXPORT_COMPONENT_FACTORY(dolphinpart, DolphinPartFactory)
+K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin<DolphinPart>();)
+K_EXPORT_PLUGIN(DolphinPartFactory("dolphin"))
-DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QStringList& args)
+DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args)
: KParts::ReadOnlyPart(parent)
{
Q_UNUSED(args)
- setComponentData( DolphinPartFactory::componentData() );
+ setComponentData(DolphinPartFactory::componentData(), false);
m_extension = new DolphinPartBrowserExtension(this);
// make sure that other apps using this part find Dolphin's view-file-columns icons
this, SLOT(slotErrorMessage(QString)));
connect(m_view, SIGNAL(itemTriggered(KFileItem)),
this, SLOT(slotItemTriggered(KFileItem)));
+ connect(m_view, SIGNAL(tabRequested(KUrl)),
+ this, SLOT(createNewWindow(KUrl)));
connect(m_view, SIGNAL(requestContextMenu(KFileItem,KUrl)),
this, SLOT(slotOpenContextMenu(KFileItem,KUrl)));
connect(m_view, SIGNAL(selectionChanged(KFileItemList)),
// TODO there was a "always open a new window" (when clicking on a directory) setting in konqueror
// (sort of spacial navigation)
+
+ loadPlugins(this, this, componentData());
}
DolphinPart::~DolphinPart()
emit m_extension->setLocationBarUrl(prettyUrl);
emit started(0); // get the wheel to spin
m_view->setUrl(url);
+ emit aboutToOpenURL();
if (reload)
m_view->reload();
return true;
// since the idea was not to need BrowserArguments for non-browser stuff...
KParts::BrowserArguments browserArgs;
browserArgs.trustedSource = true;
+ emit m_extension->openUrlRequest(item.targetUrl(), args, browserArgs);
+}
- // MMB click support.
- // TODO: this doesn't work, mouseButtons() is always 0.
- // Issue N176832 for the missing QAIV signal; task 177399
- kDebug() << QApplication::mouseButtons();
- if (QApplication::mouseButtons() & Qt::MidButton) {
- kDebug() << "MMB!!" << item.mimetype();
- if (item.mimeTypePtr()->is("inode/directory")) {
- emit m_extension->createNewWindow(item.url(), args);
- } else {
- kDebug() << "run()";
- item.run();
- }
- } else {
- // Left button. [Right button goes to slotOpenContextMenu before triggered can be emitted]
- kDebug() << "LMB";
- emit m_extension->openUrlRequest(item.targetUrl(), args, browserArgs);
- }
+void DolphinPart::createNewWindow(const KUrl& url)
+{
+ // TODO: Check issue N176832 for the missing QAIV signal; task 177399 - maybe this code
+ // should be moved into DolphinPart::slotItemTriggered()
+ KFileItem item(S_IFDIR, (mode_t)-1, url);
+ Q_ASSERT(item.mimeTypePtr()->is("inode/directory")); // the signal 'tabRequested' is only emitted for dirs
+ KParts::OpenUrlArguments args;
+ args.setMimeType(item.mimetype());
+ emit m_extension->createNewWindow(url, args);
}
void DolphinPart::slotOpenContextMenu(const KFileItem& _item, const KUrl&)