]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix Bug 153984 - Clicking cancel on the authentication dialog for fish/sftp/ftp kiosl...
authorEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Mon, 29 Oct 2012 19:54:53 +0000 (20:54 +0100)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Mon, 29 Oct 2012 19:54:53 +0000 (20:54 +0100)
BUG: 153984
REVIEW: 107116

src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kfileitemmodel.h
src/views/dolphinview.cpp
src/views/dolphinview.h

index 8a566cffd601ab8bec16f534bcfef186b39d73e6..6e99437d9aef61fd0fd72338e9d5c27c65b64a57 100644 (file)
@@ -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);
index 8a0309b0c4b8ea8a1464234260a09ddd4da0bffe..0300273c1476ce8ea22908d8e50e50d1dd7edb5e 100644 (file)
@@ -195,6 +195,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.
index 61f512a8e5505a110a351525ee6592e8b2093f96..231bfe077e2d12ce195f38d42f65fbc5b0a241b5 100644 (file)
@@ -716,6 +716,8 @@ void KFileItemModel::slotCanceled()
 {
     m_maximumUpdateIntervalTimer->stop();
     dispatchPendingItemsToInsert();
+
+    emit directoryLoadingCanceled();
 }
 
 void KFileItemModel::slotNewItems(const KFileItemList& items)
index 5bcebce247b0830156670a9249478119b62a7124..ef9dc98b9a58554f99b4afa0c64b639804ea7215 100644 (file)
@@ -216,6 +216,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.
index 9051d9827a8667338d5b1c66f150c09ff5334805..67045032d82ecbe2ed286b9829416062898c454e 100644 (file)
@@ -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>)),
index 7d8e8b76add25f90fe7f395c10797e7681a63d9f..1feaf0f11eff59d2562e7159cb18e6db5b578870 100644 (file)
@@ -483,6 +483,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.