Implement review feedback

This commit is contained in:
Janek Bevendorff committed 2018-10-19 22:16:44 +02:00
1 parent bea31f9bcc
commit 0ca7fd369a
14 files changed
+59 -65

No files matched your search

+3 -2
View File
@@ -76,7 +76,7 @@ int Remove::removeEntry(Database* database, const QString& databasePath, const Q
QTextStream out(Utils::STDOUT, QIODevice::WriteOnly);
QTextStream err(Utils::STDERR, QIODevice::WriteOnly);
Entry* entry = database->rootGroup()->findEntryByPath(entryPath);
QPointer<Entry> entry = database->rootGroup()->findEntryByPath(entryPath);
if (!entry) {
err << QObject::tr("Entry %1 not found.").arg(entryPath) << endl;
return EXIT_FAILURE;
@@ -84,7 +84,8 @@ int Remove::removeEntry(Database* database, const QString& databasePath, const Q
QString entryTitle = entry->title();
bool recycled = true;
if (Tools::hasChild(database->metadata()->recycleBin(), entry) || !database->metadata()->recycleBinEnabled()) {
auto* recycleBin = database->metadata()->recycleBin();
if (!database->metadata()->recycleBinEnabled() || (recycleBin && recycleBin->findEntryByUuid(entry->uuid()))) {
delete entry;
recycled = false;
} else {