removed compat functions in SignalVector

This commit is contained in:
fourtf
2020-02-23 19:44:13 +01:00
parent e2c493f369
commit 2ebe07bace
17 changed files with 36 additions and 58 deletions
+1 -21
View File
@@ -98,7 +98,7 @@ public:
/// signals.
int append(const T &item, void *caller = nullptr)
{
return this->insertItem(item, -1, caller);
return this->insert(item, -1, caller);
}
void removeAt(int index, void *caller = nullptr)
@@ -122,26 +122,6 @@ public:
return this->items_;
}
// compatability
[[deprecated("use insert")]] int insertItem(const T &item,
int proposedIndex = -1,
void *caller = nullptr)
{
return this->insert(item, proposedIndex, caller);
}
[[deprecated("use append")]] int appendItem(const T &item,
void *caller = nullptr)
{
return this->append(item, caller);
}
[[deprecated("use removeAt")]] void removeItem(int index,
void *caller = nullptr)
{
this->removeAt(index, caller);
}
[[deprecated]] std::vector<T> cloneVector()
{
return *this->readOnly();
+6 -6
View File
@@ -153,12 +153,12 @@ public:
else
{
int vecRow = this->getVectorIndexFromModelIndex(row);
this->vector_->removeItem(vecRow, this);
this->vector_->removeAt(vecRow, this);
assert(this->rows_[row].original);
TVectorItem item = this->getItemFromRow(
this->rows_[row].items, this->rows_[row].original.get());
this->vector_->insertItem(item, vecRow, this);
this->vector_->insert(item, vecRow, this);
}
return true;
@@ -225,7 +225,7 @@ public:
void deleteRow(int row)
{
int signalVectorRow = this->getVectorIndexFromModelIndex(row);
this->vector_->removeItem(signalVectorRow);
this->vector_->removeAt(signalVectorRow);
}
bool removeRows(int row, int count, const QModelIndex &parent) override
@@ -240,7 +240,7 @@ public:
assert(row >= 0 && row < this->rows_.size());
int signalVectorRow = this->getVectorIndexFromModelIndex(row);
this->vector_->removeItem(signalVectorRow);
this->vector_->removeAt(signalVectorRow);
return true;
}
@@ -287,8 +287,8 @@ public:
if (from != to)
{
auto item = this->vector_->raw()[from];
this->vector_->removeItem(from);
this->vector_->insertItem(item, to);
this->vector_->removeAt(from);
this->vector_->insert(item, to);
}
// We return false since we remove items ourselves.