[Pkg-owncloud-commits] [qtkeychain] 35/115: Special treatment if KWallet is unavailable.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Mar 15 19:25:44 UTC 2014


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

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

commit 7573b17ba6d3fcfee1e91d491784cbf26308e51e
Author: Frank Osterfeld <frank.osterfeld at kdab.com>
Date:   Tue May 8 17:23:26 2012 +0200

    Special treatment if KWallet is unavailable.
---
 keychain.h        | 1 +
 keychain_dbus.cpp | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/keychain.h b/keychain.h
index 79cb75a..ffd3b8b 100644
--- a/keychain.h
+++ b/keychain.h
@@ -27,6 +27,7 @@ enum Error {
     CouldNotDeleteEntry, /**< Could not delete existing secret data */
     AccessDeniedByUser, /**< User denied access to keychain */
     AccessDenied, /**< Access denied for other reasons */
+    NoBackendAvailable, /**< No platform-specific keychain service available */
     NotImplemented, /**< Not implemented on platform */
     OtherError /**< Something else went wrong (errorString() might provide details) */
 };
diff --git a/keychain_dbus.cpp b/keychain_dbus.cpp
index 03f1ad3..3c57378 100644
--- a/keychain_dbus.cpp
+++ b/keychain_dbus.cpp
@@ -24,7 +24,10 @@ void ReadPasswordJob::Private::kwalletOpenFinished( QDBusPendingCallWatcher* wat
     const QDBusPendingReply<int> reply = *watcher;
     if ( reply.isError() ) {
         const QDBusError err = reply.error();
-        q->emitFinishedWithError( OtherError, tr("Could not open wallet: %1; %2").arg( QDBusError::errorString( err.type() ), err.message() ) );
+        if ( err.type() == QDBusError::ServiceUnknown ) //KWalletd not running
+            q->emitFinishedWithError( NoBackendAvailable, tr("No keychain service available") );
+        else
+            q->emitFinishedWithError( OtherError, tr("Could not open wallet: %1; %2").arg( QDBusError::errorString( err.type() ), err.message() ) );
         return;
     }
 

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



More information about the Pkg-owncloud-commits mailing list