┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dolphinviewcontainer.cpp11
-rw-r--r--src/dolphinviewcontainer.h6
-rw-r--r--src/kitemviews/kfileitemmodel.cpp2
-rw-r--r--src/kitemviews/kfileitemmodel.h5
-rw-r--r--src/views/dolphinview.cpp1
-rw-r--r--src/views/dolphinview.h6
6 files changed, 31 insertions, 0 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index 8a566cffd..6e99437d9 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -111,6 +111,7 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
connect(m_view, SIGNAL(redirection(KUrl,KUrl)), this, SLOT(redirect(KUrl,KUrl)));
connect(m_view, SIGNAL(directoryLoadingStarted()), this, SLOT(slotDirectoryLoadingStarted()));
connect(m_view, SIGNAL(directoryLoadingCompleted()), this, SLOT(slotDirectoryLoadingCompleted()));
+ connect(m_view, SIGNAL(directoryLoadingCanceled()), this, SLOT(slotDirectoryLoadingCanceled()));
connect(m_view, SIGNAL(itemCountChanged()), this, SLOT(delayedStatusBarUpdate()));
connect(m_view, SIGNAL(directoryLoadingProgress(int)), this, SLOT(updateDirectoryLoadingProgress(int)));
connect(m_view, SIGNAL(directorySortingProgress(int)), this, SLOT(updateDirectorySortingProgress(int)));
@@ -451,6 +452,16 @@ void DolphinViewContainer::slotDirectoryLoadingCompleted()
}
}
+void DolphinViewContainer::slotDirectoryLoadingCanceled()
+{
+ if (!m_statusBar->progressText().isEmpty()) {
+ m_statusBar->setProgressText(QString());
+ m_statusBar->setProgress(100);
+ }
+
+ showErrorMessage("Directory loading has been canceled.");
+}
+
void DolphinViewContainer::slotUrlIsFileError(const KUrl& url)
{
const KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url);
diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h
index 8a0309b0c..0300273c1 100644
--- a/src/dolphinviewcontainer.h
+++ b/src/dolphinviewcontainer.h
@@ -196,6 +196,12 @@ private slots:
void slotDirectoryLoadingCompleted();
/**
+ * Updates the statusbar to show, that the directory loading has
+ * been canceled.
+ */
+ void slotDirectoryLoadingCanceled();
+
+ /**
* Is called if the URL set by DolphinView::setUrl() represents
* a file and not a directory. Takes care to activate the file.
*/
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index 61f512a8e..231bfe077 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -716,6 +716,8 @@ void KFileItemModel::slotCanceled()
{
m_maximumUpdateIntervalTimer->stop();
dispatchPendingItemsToInsert();
+
+ emit directoryLoadingCanceled();
}
void KFileItemModel::slotNewItems(const KFileItemList& items)
diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h
index 5bcebce24..ef9dc98b9 100644
--- a/src/kitemviews/kfileitemmodel.h
+++ b/src/kitemviews/kfileitemmodel.h
@@ -217,6 +217,11 @@ signals:
void directoryLoadingCompleted();
/**
+ * Is emitted after the loading of a directory has been canceled.
+ */
+ void directoryLoadingCanceled();
+
+ /**
* Informs about the progress in percent when loading a directory. It is assured
* that the signal directoryLoadingStarted() has been emitted before.
*/
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 9051d9827..67045032d 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -154,6 +154,7 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) :
connect(m_model, SIGNAL(directoryLoadingStarted()), this, SLOT(slotDirectoryLoadingStarted()));
connect(m_model, SIGNAL(directoryLoadingCompleted()), this, SLOT(slotDirectoryLoadingCompleted()));
+ connect(m_model, SIGNAL(directoryLoadingCanceled()), this, SIGNAL(directoryLoadingCanceled()));
connect(m_model, SIGNAL(directoryLoadingProgress(int)), this, SIGNAL(directoryLoadingProgress(int)));
connect(m_model, SIGNAL(directorySortingProgress(int)), this, SIGNAL(directorySortingProgress(int)));
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h
index 7d8e8b76a..1feaf0f11 100644
--- a/src/views/dolphinview.h
+++ b/src/views/dolphinview.h
@@ -484,6 +484,12 @@ signals:
void directoryLoadingCompleted();
/**
+ * Is emitted after the directory loading triggered by DolphinView::setUrl()
+ * has been canceled.
+ */
+ void directoryLoadingCanceled();
+
+ /**
* Is emitted after DolphinView::setUrl() has been invoked and provides
* the information how much percent of the current directory have been loaded.
*/