┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-09-22 19:39:46 +0000
committerPeter Penz <[email protected]>2010-09-22 19:39:46 +0000
commit5bb2a0f3c9f2d07dcb0739b88e37b203b451ecf3 (patch)
treeaece9722a8fc1d23d0c0ce791d650c5d8a20d3fe /src
parentabefc8663ac5c9dc15ad08408e224b3a3cef3b6f (diff)
Unbelievable: I simply forgot to implement the Stop-action in Dolphin since KDE SC 4.0. Well better later than never: Done now :-)
BUG: 233836 svn path=/trunk/KDE/kdebase/apps/; revision=1178344
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp15
-rw-r--r--src/dolphinmainwindow.h3
-rw-r--r--src/views/dolphinview.cpp7
-rw-r--r--src/views/dolphinview.h8
4 files changed, 33 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 41ba52419..9a5e5e3a8 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -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&)),
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index d76cf0d5c..667e3c931 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -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
*/
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index d4f489615..e9bee3186 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -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()
diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h
index 6a5d10898..f24bb6be7 100644
--- a/src/views/dolphinview.h
+++ b/src/views/dolphinview.h
@@ -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,
@@ -525,6 +527,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
*/