From 8d4fb3608927960d9e45e672ce1cbe1fa3a548f9 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 10 Oct 2007 23:01:35 +0000 Subject: DolphinPart: provide a way to switch between view modes in konqueror. Factorized those actions between dolphinmainwindow and dolphinpart (see new methods in dolphinview), and simplified mainwindow code by using the signal from the action group and the QVariant data of the actions (standard Qt4 solution for a group of actions). svn path=/trunk/KDE/kdebase/apps/; revision=723871 --- src/dolphinview.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/dolphinview.h') diff --git a/src/dolphinview.h b/src/dolphinview.h index 4e76c87c2..aef541a89 100644 --- a/src/dolphinview.h +++ b/src/dolphinview.h @@ -37,6 +37,7 @@ #include #include +class KToggleAction; class DolphinController; class KDirLister; class KFileItemDelegate; @@ -319,6 +320,29 @@ public: */ void calculateItemCount(int& fileCount, int& folderCount); + /** + * Returns the "switch to icons mode" action. + * This code is here to share it between the mainwindow and the part + */ + static KToggleAction* iconsModeAction(KActionCollection* collection); + + /** + * Returns the "switch to details mode" action. + * This code is here to share it between the mainwindow and the part + */ + static KToggleAction* detailsModeAction(KActionCollection* collection); + + /** + * Returns the "switch to columns mode" action. + * This code is here to share it between the mainwindow and the part + */ + static KToggleAction* columnsModeAction(KActionCollection* collection); + + /** + * Returns the action name corresponding to the current view mode + */ + QString currentViewModeActionName() const; + public slots: /** * Changes the directory to \a url. If the current directory is equal to @@ -603,4 +627,7 @@ private: KUrl m_rootUrl; }; +/// Allow using DolphinView::Mode in QVariant +Q_DECLARE_METATYPE(DolphinView::Mode) + #endif // DOLPHINVIEW_H -- cgit v1.3