[Pkg-owncloud-commits] [owncloud-client] 03/27: shibboleth: Fix the waiting curser that would not disapear

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Jul 29 16:23:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 86bea9a9af23358e94809fc184dd3c4ab6e9d453
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Jul 7 13:52:55 2014 +0200

    shibboleth: Fix the waiting curser that would not disapear
    
    Fix #1915
---
 src/creds/shibboleth/shibbolethwebview.cpp | 14 ++++++++++++--
 src/creds/shibboleth/shibbolethwebview.h   |  1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/creds/shibboleth/shibbolethwebview.cpp b/src/creds/shibboleth/shibbolethwebview.cpp
index 8a9f6d9..2961442 100644
--- a/src/creds/shibboleth/shibbolethwebview.cpp
+++ b/src/creds/shibboleth/shibbolethwebview.cpp
@@ -34,6 +34,7 @@ ShibbolethWebView::ShibbolethWebView(Account* account, QWidget* parent)
     : QWebView(parent)
     , _account(account)
     , _accepted(false)
+    , _cursorOverriden(false)
 {
     // no minimize
     setWindowFlags(Qt::Dialog);
@@ -79,6 +80,10 @@ void ShibbolethWebView::onNewCookiesForUrl (const QList<QNetworkCookie>& cookieL
 
 void ShibbolethWebView::closeEvent(QCloseEvent *event)
 {
+    if (_cursorOverriden) {
+        QApplication::restoreOverrideCursor();
+    }
+
     if (!_accepted) {
         Q_EMIT rejected();
     }
@@ -87,12 +92,17 @@ void ShibbolethWebView::closeEvent(QCloseEvent *event)
 
 void ShibbolethWebView::slotLoadStarted()
 {
-    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+    if (!_cursorOverriden) {
+        QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+        _cursorOverriden = true;
+    }
 }
 
 void ShibbolethWebView::slotLoadFinished(bool success)
 {
-    QApplication::restoreOverrideCursor();
+    if (_cursorOverriden) {
+        QApplication::restoreOverrideCursor();
+    }
 
     if (!title().isNull()) {
         setWindowTitle(tr("%1 - %2").arg(Theme::instance()->appNameGUI(), title()));
diff --git a/src/creds/shibboleth/shibbolethwebview.h b/src/creds/shibboleth/shibbolethwebview.h
index 37b58c8..9ba492b 100644
--- a/src/creds/shibboleth/shibbolethwebview.h
+++ b/src/creds/shibboleth/shibbolethwebview.h
@@ -55,6 +55,7 @@ private:
   void setup(Account *account, ShibbolethCookieJar* jar);
   QPointer<Account> _account;
   bool _accepted;
+  bool _cursorOverriden;
 };
 
 } // ns Mirall

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list