diff --git a/src/pickerwidget.h b/src/pickerwidget.h index bd4cd9c..700b391 100644 --- a/src/pickerwidget.h +++ b/src/pickerwidget.h @@ -50,21 +50,21 @@ class PickerWidget : public QDialog { template void dbdiff(std::vector orig, std::vector work, QString folder) { if (orig.size() < work.size()) { // note non-empty additions in new chunks - for (int i = orig.size(); i == work.size(); i++) { + for (int i = orig.size(); i <= work.size(); i++) { if (work[i-1] != T()) { addModelItem(folder, lcfops::id_with_name(i-1, ToQString(work[i-1].name)), "+", 1); } } } else if (orig.size() > work.size()) { // note non-empty removals in removed chunks - for (int i = work.size(); i == orig.size(); i++) { + for (int i = work.size(); i <= orig.size(); i++) { if (orig[i-1] != T()) { addModelItem(folder, lcfops::id_with_name(i-1, ToQString(orig[i-1].name)), "i", 1); } } } // note additions for slots shared between both databases - for (int i = 0, total = (work.size() < orig.size() ? orig.size() - 1 : work.size() - 1); i <= total; ++i) { + for (int i = 0, total = (work.size() < orig.size() ? work.size() - 1 : orig.size() - 1); i <= total; ++i) { if (orig[i] != work[i]) { QString comp = lcfops::compare(orig[i], work[i]); if (comp == "-") {