[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:05:38 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=03e4550
The following commit has been merged in the master branch:
commit 03e4550beaf8fd5a11945831b1c0ff5208424db6
Author: Dan Vrátil <dvratil at redhat.com>
Date: Thu Oct 25 14:55:30 2012 +0200
Reopen wallet if it was force-closed
BUG: 308973
REVIEW: 107034
FIXED-IN: 0.5.2
---
KTp/wallet-interface.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/KTp/wallet-interface.cpp b/KTp/wallet-interface.cpp
index c60899a..428c02e 100644
--- a/KTp/wallet-interface.cpp
+++ b/KTp/wallet-interface.cpp
@@ -29,6 +29,8 @@ class KTp::WalletInterfacePrivate
{
public:
WalletInterfacePrivate();
+ void ensureWalletIsReady();
+
QScopedPointer<KWallet::Wallet> wallet;
static const QLatin1String folderName;
static const QLatin1String mapsPrefix;
@@ -40,6 +42,15 @@ using KTp::WalletInterfacePrivate;
const QLatin1String WalletInterfacePrivate::folderName = QLatin1String("telepathy-kde");
const QLatin1String WalletInterfacePrivate::mapsPrefix = QLatin1String("maps/");
+void WalletInterfacePrivate::ensureWalletIsReady()
+{
+ // If wallet was force-closed since last WalletInterface::openWallet(),
+ // try to reopen it.
+ if (wallet && !wallet->isOpen()) {
+ wallet.reset(KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), 0, KWallet::Wallet::Asynchronous));
+ }
+}
+
WalletInterfacePrivate::WalletInterfacePrivate() :
wallet(KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), 0, KWallet::Wallet::Asynchronous))
@@ -49,6 +60,8 @@ WalletInterfacePrivate::WalletInterfacePrivate() :
KTp::PendingWallet* WalletInterface::openWallet()
{
K_GLOBAL_STATIC(KTp::WalletInterface, s_instance);
+
+ s_instance->d->ensureWalletIsReady();
return new PendingWallet(s_instance);
}
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list