]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Unbelievable: I simply forgot to implement the Stop-action in Dolphin since KDE SC...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 22 Sep 2010 19:39:46 +0000 (19:39 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 22 Sep 2010 19:39:46 +0000 (19:39 +0000)
BUG: 233836

svn path=/trunk/KDE/kdebase/apps/; revision=1178344

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/views/dolphinview.cpp
src/views/dolphinview.h

index 41ba52419b495597de300da1a415f9f84adfd760..9a5e5e3a8610c9b16688757880febfb8ba38547a 100644 (file)
@@ -791,6 +791,17 @@ void DolphinMainWindow::reloadView()
 
 void DolphinMainWindow::stopLoading()
 {
+    m_activeViewContainer->view()->stopLoading();
+}
+
+void DolphinMainWindow::enableStopAction()
+{
+    actionCollection()->action("stop")->setEnabled(true);
+}
+
+void DolphinMainWindow::disableStopAction()
+{
+    actionCollection()->action("stop")->setEnabled(false);
 }
 
 void DolphinMainWindow::toggleFilterBarVisibility(bool show)
@@ -1689,6 +1700,10 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
             this, SLOT(openNewTab(const KUrl&)));
     connect(view, SIGNAL(requestContextMenu(KFileItem, const KUrl&, const QList<QAction*>&)),
             this, SLOT(openContextMenu(KFileItem, const KUrl&, const QList<QAction*>&)));
+    connect(view, SIGNAL(startedPathLoading(KUrl)),
+            this, SLOT(enableStopAction()));
+    connect(view, SIGNAL(finishedPathLoading(KUrl)),
+            this, SLOT(disableStopAction()));
 
     const KUrlNavigator* navigator = container->urlNavigator();
     connect(navigator, SIGNAL(urlChanged(const KUrl&)),
index d76cf0d5c04b3b8f5ed8b8c562dba660d67e8ef4..667e3c931408bf25ef03dfd5585c3f0a08d1a88e 100644 (file)
@@ -247,6 +247,9 @@ private slots:
     /** Stops the loading process for the current active view. */
     void stopLoading();
 
+    void enableStopAction();
+    void disableStopAction();
+
     /**
      * Toggles between showing and hiding of the filter bar
      */
index d4f489615cfc6853c5f5e4850b2a3e7f7015032b..e9bee31863936bd671c12ced747830102090d688 100644 (file)
@@ -437,6 +437,11 @@ void DolphinView::reload()
     restoreState(restoreStream);
 }
 
+void DolphinView::stopLoading()
+{
+    m_viewAccessor.dirLister()->stop();
+}
+
 void DolphinView::refresh()
 {
     const bool oldActivationState = m_active;
@@ -1161,6 +1166,8 @@ void DolphinView::slotLoadingCompleted()
     // Restore the contents position. This has to be done using a Qt::QueuedConnection
     // because the view might not be in its final state yet.
     QMetaObject::invokeMethod(this, "restoreContentsPosition", Qt::QueuedConnection);
+
+    emit finishedPathLoading(url());
 }
 
 void DolphinView::slotRefreshItems()
index 6a5d1089899cb3942330f3b24bc3180e9ed0754c..f24bb6be747872a5b27934c89550324575f69026 100644 (file)
@@ -257,6 +257,8 @@ public:
     /** Reloads the current directory. */
     void reload();
 
+    void stopLoading();
+
     /**
      * Refreshes the view to get synchronized with the (updated) Dolphin settings.
      * This method only needs to get invoked if the view settings for the Icons View,
@@ -524,6 +526,12 @@ signals:
      */
     void startedPathLoading(const KUrl& url);
 
+    /**
+     * Is emitted after the path triggered by DolphinView::setUrl()
+     * has been loaded.
+     */
+    void finishedPathLoading(const KUrl& url);
+
     /**
      * Emitted when KDirLister emits redirection.
      * Testcase: fish://localhost