From e5eae108ca4511be9dae5f8bb4a4e1fbb0d89c7a Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 25 Jan 2010 07:58:24 +0000 Subject: * Adjust code to use the improved KUrlNavigator API. * Open a new tab if the URL navigator requests it. * Get rid of a cyclic dependency between DolphinViewContainer and DolphinMainWindow. BUG: 181223 svn path=/trunk/KDE/kdebase/apps/; revision=1079843 --- src/dolphinviewcontainer.h | 52 ++++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 36 deletions(-) (limited to 'src/dolphinviewcontainer.h') diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index 0f2ab9aad..ce5badfa2 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -41,7 +41,6 @@ class KUrl; class DolphinModel; class KUrlNavigator; class DolphinDirLister; -class DolphinMainWindow; class DolphinSortFilterProxyModel; class DolphinStatusBar; @@ -62,17 +61,14 @@ class DolphinViewContainer : public QWidget Q_OBJECT public: - DolphinViewContainer(DolphinMainWindow* mainwindow, - QWidget *parent, - const KUrl& url); - + DolphinViewContainer(const KUrl& url, QWidget* parent); virtual ~DolphinViewContainer(); /** * Returns the current active URL, where all actions are applied. * The URL navigator is synchronized with this URL. */ - const KUrl& url() const; + KUrl url() const; /** * If \a active is true, the view container will marked as active. The active @@ -84,12 +80,6 @@ public: const DolphinStatusBar* statusBar() const; DolphinStatusBar* statusBar(); - /** - * Returns true, if the URL shown by the navigation bar is editable. - * @see KUrlNavigator - */ - bool isUrlEditable() const; - const KUrlNavigator* urlNavigator() const; KUrlNavigator* urlNavigator(); @@ -125,6 +115,13 @@ signals: */ void showFilterBarChanged(bool shown); + /** + * Is emitted when the write state of the folder has been changed. The application + * should disable all actions like "Create New..." that depend on the write + * state. + */ + void writeStateChanged(bool isFolderWritable); + private slots: /** * Updates the number of items (= number of files + number of @@ -188,23 +185,7 @@ private slots: */ void setNameFilter(const QString& nameFilter); - /** - * Opens the context menu on the current mouse position. - * @item File item context. If item is null, the context menu - * should be applied to \a url. - * @url URL which contains \a item. - * @customActions Actions that should be added to the context menu, - * if the file item is null. - */ - void openContextMenu(const KFileItem& item, - const KUrl& url, - const QList& customActions); - - /** - * Saves the position of the contents to the - * current history element. - */ - void saveContentsPos(int x, int y); + void restoreViewState(); /** * Marks the view container as active @@ -213,16 +194,16 @@ private slots: void activate(); /** - * Restores the current view to show \a url and assures - * that the root URL of the view is respected. + * Saves the state of the current view: contents position, + * root URL, ... */ - void restoreView(const KUrl& url); + void saveViewState(); /** - * Saves the root URL of the current URL \a url - * into the URL navigator. + * Restores the current view to show \a url and assures + * that the root URL of the view is respected. */ - void saveRootUrl(const KUrl& url); + void slotUrlNavigatorLocationChanged(const KUrl& url); /** * Is connected with the URL navigator and drops the URLs @@ -251,7 +232,6 @@ private slots: private: bool m_isFolderWritable; - DolphinMainWindow* m_mainWindow; QVBoxLayout* m_topLayout; KUrlNavigator* m_urlNavigator; -- cgit v1.3