From f8302197daca5667aa3d4963528ce09e344eb27f Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 15 Nov 2007 20:04:05 +0000 Subject: Implement cut/copy/paste in dolphinpart. Had to move more code to DolphinView, to use it from the part. svn path=/trunk/KDE/kdebase/apps/; revision=737203 --- src/dolphinpart.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/dolphinpart.h') diff --git a/src/dolphinpart.h b/src/dolphinpart.h index bf81b55f4..114c21d31 100644 --- a/src/dolphinpart.h +++ b/src/dolphinpart.h @@ -21,6 +21,7 @@ #define DOLPHINPART_H #include +#include class KFileItemList; class KFileItem; class DolphinPartBrowserExtension; @@ -50,6 +51,8 @@ public: /// see the supportsUndo property bool supportsUndo() const { return true; } + DolphinView* view() { return m_view; } + protected: /** * We reimplement openUrl so no need to implement openFile. @@ -99,6 +102,12 @@ private Q_SLOTS: */ void updateViewActions(); + /** + * Updates the text of the paste action dependent from + * the number of items which are in the clipboard. + */ + void updatePasteAction(); + private: void createActions(); @@ -111,4 +120,20 @@ private: Q_DISABLE_COPY(DolphinPart) }; +class DolphinPartBrowserExtension : public KParts::BrowserExtension +{ + Q_OBJECT +public: + DolphinPartBrowserExtension( DolphinPart* part ) + : KParts::BrowserExtension( part ), m_part(part) {} + +public Q_SLOTS: + void cut(); + void copy(); + void paste(); + +private: + DolphinPart* m_part; +}; + #endif /* DOLPHINPART_H */ -- cgit v1.3