diff options
| author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-01-05 14:05:44 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-01-05 14:46:09 +0100 |
| commit | 9d446718e2f9a74f9363ae919ea2ec406bd38aba (patch) | |
| tree | 0fa4f5efe5148a3ee3c00208cc7c1e1633a31131 /src | |
| parent | a5eae8651b0a328c1db3a6c2380eda5dc8773398 (diff) | |
| download | kristall-9d446718e2f9a74f9363ae919ea2ec406bd38aba.tar.gz | |
{TrustedHost,Favourite}Collection: fix duplicating/removing the last item
Fixes: #112
Diffstat (limited to 'src')
| -rw-r--r-- | src/favouritecollection.cpp | 4 | ||||
| -rw-r--r-- | src/trustedhostcollection.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/favouritecollection.cpp b/src/favouritecollection.cpp index 2472610..bc387c2 100644 --- a/src/favouritecollection.cpp +++ b/src/favouritecollection.cpp @@ -619,10 +619,10 @@ bool FavouriteCollection::dropMimeData(const QMimeData *data, Qt::DropAction act auto & insert_list = item->as<GroupNode>().children; if((row < 0) or (size_t(row) >= insert_list.size())) { - beginInsertRows(parent, insert_list.size(), insert_list.size() + 1); + beginInsertRows(parent, insert_list.size(), insert_list.size()); insert_list.emplace_back(std::move(node)); } else { - beginInsertRows(parent, row, row + 1); + beginInsertRows(parent, row, row); insert_list.emplace(insert_list.begin() + size_t(row), std::move(node)); } endInsertRows(); diff --git a/src/trustedhostcollection.cpp b/src/trustedhostcollection.cpp index 5171fd3..bbc7720 100644 --- a/src/trustedhostcollection.cpp +++ b/src/trustedhostcollection.cpp @@ -142,7 +142,7 @@ void TrustedHostCollection::remove(const QModelIndex &index) return; if(index.row() < 0 or index.row() >= items.size()) return; - beginRemoveRows(QModelIndex{}, index.row(), index.row() + 1); + beginRemoveRows(QModelIndex{}, index.row(), index.row()); items.removeAt(index.row()); endRemoveRows(); } |
