#include "views/dolphinviewactionhandler.h"
#include "views/dolphinnewfilemenuobserver.h"
#include "views/dolphinremoteencoding.h"
+#include "kitemviews/kfileitemmodel.h"
+#include "kitemviews/private/kfileitemmodeldirlister.h"
#include <QActionGroup>
#include <QApplication>
new DolphinPartFileInfoExtension(this);
new DolphinPartListingFilterExtension(this);
+ KDirLister* lister = m_view->m_model->m_dirLister;
+ if (lister) {
+ DolphinPartListingNotificationExtension* notifyExt = new DolphinPartListingNotificationExtension(this);
+ connect(lister, SIGNAL(newItems(KFileItemList)), notifyExt, SLOT(slotNewItems(KFileItemList)));
+ connect(lister, SIGNAL(itemsDeleted(KFileItemList)), notifyExt, SLOT(slotItemsDeleted(KFileItemList)));
+ } else {
+ kWarning() << "NULL KDirLister object! KParts::ListingNotificationExtension will NOT be supported";
+ }
+
createActions();
m_actionHandler->updateViewActions();
slotSelectionChanged(KFileItemList()); // initially disable selection-dependent actions
// (sort of spacial navigation)
loadPlugins(this, this, componentData());
-
}
DolphinPart::~DolphinPart()
}
}
+////
+
+DolphinPartListingNotificationExtension::DolphinPartListingNotificationExtension(DolphinPart* part)
+ :KParts::ListingNotificationExtension(part)
+{
+}
+
+KParts::ListingNotificationExtension::NotificationEventTypes DolphinPartListingNotificationExtension::supportedNotificationEventTypes() const
+{
+ return (KParts::ListingNotificationExtension::ItemsAdded |
+ KParts::ListingNotificationExtension::ItemsDeleted);
+}
+
+void DolphinPartListingNotificationExtension::slotNewItems(const KFileItemList& items)
+{
+ emit listingEvent(KParts::ListingNotificationExtension::ItemsAdded, items);
+}
+
+void DolphinPartListingNotificationExtension::slotItemsDeleted(const KFileItemList& items)
+{
+ emit listingEvent(KParts::ListingNotificationExtension::ItemsDeleted, items);
+}
+
#include "dolphinpart.moc"
DolphinPart* m_part;
};
+class DolphinPartListingNotificationExtension : public KParts::ListingNotificationExtension
+{
+ Q_OBJECT
+
+public:
+ DolphinPartListingNotificationExtension(DolphinPart* part);
+ virtual NotificationEventTypes supportedNotificationEventTypes() const;
+
+public Q_SLOTS:
+ void slotNewItems(const KFileItemList&);
+ void slotItemsDeleted(const KFileItemList&);
+};
+
#endif /* DOLPHINPART_H */