Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
varjolintu committed Sep 2, 2024
1 parent f2d942a commit c57cd46
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
10 changes: 5 additions & 5 deletions share/translations/keepassxc_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8902,17 +8902,17 @@ This option is deprecated, use --set-key-file instead.</source>
<source>Cannot generate valid passphrases because the wordlist is too short</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<message>
<source>Delete plugin data?</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<source>Delete plugin data from Entry(s)?</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>Delete plugin data from Entry(s)?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QtIOCompressor</name>
Expand Down
9 changes: 9 additions & 0 deletions src/browser/BrowserService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,15 @@ bool BrowserService::deleteEntry(const QString& uuid)
return true;
}

void BrowserService::removePluginData(Entry* entry) const
{
if (!entry) {
return;
}

entry->customData()->remove(BrowserService::KEEPASSXCBROWSER_NAME);
}

QList<Entry*> BrowserService::searchEntries(const QSharedPointer<Database>& db,
const QString& siteUrl,
const QString& formUrl,
Expand Down
1 change: 1 addition & 0 deletions src/browser/BrowserService.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class BrowserService : public QObject
const QSharedPointer<Database>& selectedDb = {});
bool updateEntry(const EntryParameters& entryParameters, const QString& uuid);
bool deleteEntry(const QString& uuid);
void removePluginData(Entry* entry) const;
QJsonArray findEntries(const EntryParameters& entryParameters, const StringPairList& keyList, bool* entriesFound);
void requestGlobalAutoType(const QString& search);

Expand Down
4 changes: 2 additions & 2 deletions src/gui/GuiTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ namespace GuiTools
}

auto answer = MessageBox::question(parent,
QObject::tr("Delete plugin data?", "", entries.size()),
QObject::tr("Delete plugin data from Entry(s)?"),
QObject::tr("Delete plugin data?"),
QObject::tr("Delete plugin data from Entry(s)?", "", entries.size()),
MessageBox::Delete | MessageBox::Cancel,
MessageBox::Cancel);

Expand Down
2 changes: 1 addition & 1 deletion src/gui/dbsettings/DatabaseSettingsWidgetBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void DatabaseSettingsWidgetBrowser::removeStoredPermissions()

if (entry->customData()->contains(BrowserService::KEEPASSXCBROWSER_NAME)) {
entry->beginUpdate();
entry->customData()->remove(BrowserService::KEEPASSXCBROWSER_NAME);
browserService()->removePluginData(entry);
entry->endUpdate();
++counter;
}
Expand Down
1 change: 1 addition & 0 deletions src/gui/reports/ReportsWidgetBrowserStatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ void ReportsWidgetBrowserStatistics::deletePluginDataFromSelectedEntries()
if (GuiTools::confirmDeletePluginData(this, selectedEntries)) {
for (auto& entry : selectedEntries) {
entry->customData()->remove(BrowserService::KEEPASSXCBROWSER_NAME);
browserService()->removePluginData(entry);
}
}

Expand Down

0 comments on commit c57cd46

Please sign in to comment.