1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

[PasswordManager] change return type of updateEntry() to bool.

This commit is contained in:
S. Razi Alavizadeh 2013-06-08 15:44:00 +04:30
parent 6342884e86
commit aaf082a332
11 changed files with 21 additions and 17 deletions

View File

@ -149,9 +149,9 @@ void AutoFill::updateEntry(const QUrl &url, const QString &name, const QString &
}
// WEB Form
void AutoFill::updateEntry(const PasswordEntry &entry)
bool AutoFill::updateEntry(const PasswordEntry &entry)
{
m_manager->updateEntry(entry);
return m_manager->updateEntry(entry);
}
void AutoFill::removeEntry(const PasswordEntry &entry)

View File

@ -55,7 +55,7 @@ public:
void addEntry(const QUrl &url, const PageFormData &formData);
void updateEntry(const QUrl &url, const QString &name, const QString &pass);
void updateEntry(const PasswordEntry &entry);
bool updateEntry(const PasswordEntry &entry);
void removeEntry(const PasswordEntry &entry);
void removeAllEntries();

View File

@ -105,7 +105,7 @@ void DatabasePasswordBackend::addEntry(const PasswordEntry &entry)
query.exec();
}
void DatabasePasswordBackend::updateEntry(const PasswordEntry &entry)
bool DatabasePasswordBackend::updateEntry(const PasswordEntry &entry)
{
QSqlQuery query;
@ -124,7 +124,7 @@ void DatabasePasswordBackend::updateEntry(const PasswordEntry &entry)
query.addBindValue(entry.id);
}
query.exec();
return query.exec();
}
void DatabasePasswordBackend::updateLastUsed(PasswordEntry &entry)

View File

@ -31,7 +31,7 @@ public:
QVector<PasswordEntry> getAllEntries();
void addEntry(const PasswordEntry &entry);
void updateEntry(const PasswordEntry &entry);
bool updateEntry(const PasswordEntry &entry);
void updateLastUsed(PasswordEntry &entry);
void removeEntry(const PasswordEntry &entry);

View File

@ -34,7 +34,7 @@ public:
virtual QVector<PasswordEntry> getAllEntries() = 0;
virtual void addEntry(const PasswordEntry &entry) = 0;
virtual void updateEntry(const PasswordEntry &entry) = 0;
virtual bool updateEntry(const PasswordEntry &entry) = 0;
virtual void updateLastUsed(PasswordEntry &entry) = 0;
virtual void removeEntry(const PasswordEntry &entry) = 0;

View File

@ -95,10 +95,10 @@ void PasswordManager::addEntry(const PasswordEntry &entry)
m_backend->addEntry(entry);
}
void PasswordManager::updateEntry(const PasswordEntry &entry)
bool PasswordManager::updateEntry(const PasswordEntry &entry)
{
ensureLoaded();
m_backend->updateEntry(entry);
return m_backend->updateEntry(entry);
}
void PasswordManager::updateLastUsed(PasswordEntry &entry)

View File

@ -66,7 +66,7 @@ public:
QVector<PasswordEntry> getAllEntries();
void addEntry(const PasswordEntry &entry);
void updateEntry(const PasswordEntry &entry);
bool updateEntry(const PasswordEntry &entry);
void updateLastUsed(PasswordEntry &entry);
void removeEntry(const PasswordEntry &entry);

View File

@ -144,7 +144,7 @@ void GnomeKeyringPasswordBackend::addEntry(const PasswordEntry &entry)
m_allEntries.append(stored);
}
void GnomeKeyringPasswordBackend::updateEntry(const PasswordEntry &entry)
bool GnomeKeyringPasswordBackend::updateEntry(const PasswordEntry &entry)
{
initialize();
@ -159,7 +159,7 @@ void GnomeKeyringPasswordBackend::updateEntry(const PasswordEntry &entry)
if (result != GNOME_KEYRING_RESULT_OK) {
qWarning() << "GnomeKeyringPasswordBackend::updateEntry Cannot updated entry attributes in keyring!";
return;
return false;
}
// Update secret
@ -169,7 +169,7 @@ void GnomeKeyringPasswordBackend::updateEntry(const PasswordEntry &entry)
if (result != GNOME_KEYRING_RESULT_OK) {
qWarning() << "GnomeKeyringPasswordBackend::updateEntry Cannot get entry info from keyring!";
return;
return false;
}
QByteArray pass = entry.password.toUtf8();
@ -181,7 +181,7 @@ void GnomeKeyringPasswordBackend::updateEntry(const PasswordEntry &entry)
if (result != GNOME_KEYRING_RESULT_OK) {
qWarning() << "GnomeKeyringPasswordBackend::updateEntry Cannot set entry info in keyring!";
return;
return false;
}
int index = m_allEntries.indexOf(entry);
@ -189,6 +189,8 @@ void GnomeKeyringPasswordBackend::updateEntry(const PasswordEntry &entry)
if (index > -1) {
m_allEntries[index] = entry;
}
return true;
}
void GnomeKeyringPasswordBackend::updateLastUsed(PasswordEntry &entry)

View File

@ -34,7 +34,7 @@ public:
QVector<PasswordEntry> getAllEntries();
void addEntry(const PasswordEntry &entry);
void updateEntry(const PasswordEntry &entry);
bool updateEntry(const PasswordEntry &entry);
void updateLastUsed(PasswordEntry &entry);
void removeEntry(const PasswordEntry &entry);

View File

@ -87,7 +87,7 @@ void KWalletPasswordBackend::addEntry(const PasswordEntry &entry)
m_allEntries.append(stored);
}
void KWalletPasswordBackend::updateEntry(const PasswordEntry &entry)
bool KWalletPasswordBackend::updateEntry(const PasswordEntry &entry)
{
initialize();
@ -99,6 +99,8 @@ void KWalletPasswordBackend::updateEntry(const PasswordEntry &entry)
if (index > -1) {
m_allEntries[index] = entry;
}
return true;
}
void KWalletPasswordBackend::updateLastUsed(PasswordEntry &entry)

View File

@ -36,7 +36,7 @@ public:
QVector<PasswordEntry> getAllEntries();
void addEntry(const PasswordEntry &entry);
void updateEntry(const PasswordEntry &entry);
bool updateEntry(const PasswordEntry &entry);
void updateLastUsed(PasswordEntry &entry);
void removeEntry(const PasswordEntry &entry);