diff --git a/src/lib/autofill/passwordbackends/passwordbackend.cpp b/src/lib/autofill/passwordbackends/passwordbackend.cpp new file mode 100644 index 000000000..44632c7cb --- /dev/null +++ b/src/lib/autofill/passwordbackends/passwordbackend.cpp @@ -0,0 +1,33 @@ +/* ============================================================ +* QupZilla - WebKit based browser +* Copyright (C) 2013 David Rosca +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* ============================================================ */ +#include "passwordbackend.h" + +PasswordBackend::PasswordBackend() + : m_active(false) +{ +} + +void PasswordBackend::setActive(bool active) +{ + m_active = active; +} + +bool PasswordBackend::isActive() const +{ + return m_active; +} diff --git a/src/lib/autofill/passwordbackends/passwordbackend.h b/src/lib/autofill/passwordbackends/passwordbackend.h index f4b990b9b..6bb5626e8 100644 --- a/src/lib/autofill/passwordbackends/passwordbackend.h +++ b/src/lib/autofill/passwordbackends/passwordbackend.h @@ -23,7 +23,7 @@ class PasswordBackend { public: - explicit PasswordBackend() { } + explicit PasswordBackend(); virtual ~PasswordBackend() { } virtual QVector getEntries(const QUrl &url) = 0; @@ -35,6 +35,12 @@ public: virtual void removeEntry(const PasswordEntry &entry) = 0; virtual void removeAll() = 0; + + void setActive(bool active); + bool isActive() const; + +private: + bool m_active; }; #endif // PASSWORDBACKEND_H diff --git a/src/lib/autofill/passwordmanager.cpp b/src/lib/autofill/passwordmanager.cpp index 6382aa4b1..4b93e6921 100644 --- a/src/lib/autofill/passwordmanager.cpp +++ b/src/lib/autofill/passwordmanager.cpp @@ -39,6 +39,7 @@ void PasswordManager::loadSettings() settings.endGroup(); m_backend = m_backends[m_backends.contains(backendId) ? backendId : "database"]; + m_backend->setActive(true); } QVector PasswordManager::getEntries(const QUrl &url) diff --git a/src/lib/lib.pro b/src/lib/lib.pro index 9d2a61880..26af73c2a 100644 --- a/src/lib/lib.pro +++ b/src/lib/lib.pro @@ -217,7 +217,8 @@ SOURCES += \ network/pac/pacmanager.cpp \ tools/delayedfilewatcher.cpp \ autofill/passwordmanager.cpp \ - autofill/passwordbackends/databasepasswordbackend.cpp + autofill/passwordbackends/databasepasswordbackend.cpp \ + autofill/passwordbackends/passwordbackend.cpp HEADERS += \ webview/tabpreview.h \