diff --git a/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.cpp b/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.cpp index 6b430af9c..620233936 100644 --- a/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.cpp +++ b/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.cpp @@ -19,6 +19,7 @@ #include "kdeframeworksintegrationplugin.h" #include "mainapplication.h" #include "browserwindow.h" +#include "desktopnotificationsfactory.h" #include @@ -83,6 +84,7 @@ void KWalletPasswordBackend::addEntry(const PasswordEntry &entry) initialize(); if (!m_wallet) { + showErrorNotification(); return; } @@ -99,6 +101,7 @@ bool KWalletPasswordBackend::updateEntry(const PasswordEntry &entry) initialize(); if (!m_wallet) { + showErrorNotification(); return false; } @@ -119,6 +122,7 @@ void KWalletPasswordBackend::updateLastUsed(PasswordEntry &entry) initialize(); if (!m_wallet) { + showErrorNotification(); return; } @@ -140,6 +144,7 @@ void KWalletPasswordBackend::removeEntry(const PasswordEntry &entry) initialize(); if (!m_wallet) { + showErrorNotification(); return; } @@ -157,6 +162,7 @@ void KWalletPasswordBackend::removeAll() initialize(); if (!m_wallet) { + showErrorNotification(); return; } @@ -166,6 +172,16 @@ void KWalletPasswordBackend::removeAll() m_wallet->createFolder("Falkon"); } +void KWalletPasswordBackend::showErrorNotification() +{ + static bool initialized; + + if (!initialized) { + initialized = true; + mApp->desktopNotifications()->showNotification(KDEFrameworksIntegrationPlugin::tr("KWallet disabled"), KDEFrameworksIntegrationPlugin::tr("Please enable KWallet to save password.")); + } +} + void KWalletPasswordBackend::initialize() { if (m_wallet) { diff --git a/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.h b/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.h index 1785e219c..e4ccaf287 100644 --- a/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.h +++ b/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.h @@ -47,6 +47,7 @@ public: private: void initialize(); + void showErrorNotification(); KWallet::Wallet* m_wallet; QVector m_allEntries;