Skip to content

Commit 400d6b2

Browse files
authored
Merge pull request #1008 from deXol/develop
Fix delete credential in MMM issue
2 parents 1d9f693 + 648456f commit 400d6b2

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/CredentialsManagement.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,11 @@ bool CredentialsManagement::confirmDiscardUneditedCredentialChanges(const QModel
535535

536536
if (pLoginItem != nullptr)
537537
{
538+
if (pLoginItem->isDeleted())
539+
{
540+
// Do not need to check for discard, login is deleted
541+
return true;
542+
}
538543
// Retrieve parent item
539544
TreeItem *pServiceItem = pLoginItem->parentItem();
540545
if (pServiceItem != nullptr)
@@ -549,7 +554,7 @@ bool CredentialsManagement::confirmDiscardUneditedCredentialChanges(const QModel
549554

550555
if ((!sPassword.isEmpty() && (sPassword != pLoginItem->password())) ||
551556
(!sDescription.isEmpty() && (sDescription != pLoginItem->description())) ||
552-
(sLogin != pLoginItem->name()) ||
557+
(!sLogin.isEmpty() && sLogin != pLoginItem->name()) ||
553558
(wsClient->isMPBLE() && iCategory != 0 && iCategory != pLoginItem->category()) ||
554559
(wsClient->isMPBLE() && iKeyAfterLogin != SettingsGuiBLE::DEFAULT_INDEX && iKeyAfterLogin != pLoginItem->keyAfterLogin()) ||
555560
(wsClient->isMPBLE() && iKeyAfterPwd != SettingsGuiBLE::DEFAULT_INDEX && iKeyAfterPwd != pLoginItem->keyAfterPwd()))
@@ -826,6 +831,7 @@ void CredentialsManagement::on_pushButtonDelete_clicked()
826831
{
827832
ui->credDisplayFrame->setEnabled(false);
828833
clearLoginDescription();
834+
pLoginItem->setDeleted(true);
829835

830836
QModelIndexList nextRow = m_pCredModelFilter->getNextRow(lIndexes.at(0));
831837
auto selectionModel = ui->credentialTreeView->selectionModel();

src/DbBackupsTrackerController.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ void DbBackupsTrackerController::setBackupFilePath(const QString &path)
7676
{
7777
// Just ignore it
7878
}
79-
if (path.isEmpty())
80-
{
81-
disconnectDbBackupsTracker();
82-
}
8379
}
8480

8581
void DbBackupsTrackerController::handleCardDbMetadataChanged(QString cardId,

src/LoginItem.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@ class LoginItem : public TreeItem
2828
virtual TreeType treeType() const Q_DECL_OVERRIDE;
2929
void setTOTPCredential(QString secretKey, int timeStep, int codeSize);
3030
void setTOTPDeleted(bool deleted) { m_totpDeleted = deleted; }
31+
void setDeleted(bool val) { m_bDeleted = val; }
32+
bool isDeleted() const { return m_bDeleted; }
3133
private:
3234
QByteArray m_bAddress;
3335
qint8 m_iFavorite;
3436
QString m_sPassword;
3537
QString m_sPasswordOrig;
3638
bool m_bPasswordLocked;
39+
bool m_bDeleted = false;
3740

3841
struct TOTPCredential
3942
{

0 commit comments

Comments
 (0)