1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

[PasswordManager] Make backends aware of being active.

This commit is contained in:
nowrep 2013-05-15 15:04:48 +02:00
parent 2fea323af1
commit 06323ee7b8
4 changed files with 43 additions and 2 deletions

View File

@ -0,0 +1,33 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2013 David Rosca <nowrep@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "passwordbackend.h"
PasswordBackend::PasswordBackend()
: m_active(false)
{
}
void PasswordBackend::setActive(bool active)
{
m_active = active;
}
bool PasswordBackend::isActive() const
{
return m_active;
}

View File

@ -23,7 +23,7 @@
class PasswordBackend
{
public:
explicit PasswordBackend() { }
explicit PasswordBackend();
virtual ~PasswordBackend() { }
virtual QVector<PasswordEntry> 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

View File

@ -39,6 +39,7 @@ void PasswordManager::loadSettings()
settings.endGroup();
m_backend = m_backends[m_backends.contains(backendId) ? backendId : "database"];
m_backend->setActive(true);
}
QVector<PasswordEntry> PasswordManager::getEntries(const QUrl &url)

View File

@ -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 \