Skip to content
Snippets Groups Projects
Commit 6e5bb118 authored by Johannes Zarl-Zierl's avatar Johannes Zarl-Zierl
Browse files

DuplicateMerger: don't delete destination image.

When a duplicate is not a different file but just a duplicate entry in
the database, only remove the database entry, not the image file.

CCBUG: 320473
parent f44d978d
No related branches found
No related tags found
No related merge requests found
......@@ -121,16 +121,22 @@ void DuplicateMatch::execute(Utilities::DeleteMethod method)
}
}
DB::FileNameList list;
DB::FileNameList deleteList, dupList;
Q_FOREACH( QRadioButton* button, m_buttons ) {
if (button->isChecked())
continue;
DB::FileName fileName = button->property("data").value<DB::FileName>();
DB::ImageDB::instance()->copyData(fileName, destination);
list.append(fileName);
// can we safely delete the file?
if ( fileName != destination )
deleteList.append(fileName);
else
dupList.append(fileName);
}
Utilities::DeleteFiles::deleteFiles(list, method);
Utilities::DeleteFiles::deleteFiles(deleteList, method);
// remove duplicate DB-entries without removing or blocking the file:
DB::ImageDB::instance()->deleteList(dupList);
}
bool DuplicateMatch::eventFilter(QObject* obj, QEvent* event)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment