gnome: adapt to LRC api change
dropping of 'const' modifier:
CollectionEditor::addNew(const T* item) -> addNew(T* item)
Issue: #78236
Change-Id: Id78f2927c39d211be1c959fd33f7e0718e0dc780
diff --git a/src/backends/edscontactbackend.cpp b/src/backends/edscontactbackend.cpp
index e5afe4b..8ea145c 100644
--- a/src/backends/edscontactbackend.cpp
+++ b/src/backends/edscontactbackend.cpp
@@ -98,7 +98,7 @@
virtual bool save ( const Person* item ) override;
virtual bool remove ( const Person* item ) override;
virtual bool edit ( Person* item ) override;
- virtual bool addNew ( const Person* item ) override;
+ virtual bool addNew ( Person* item ) override;
virtual bool addExisting( const Person* item ) override;
private:
@@ -135,16 +135,11 @@
return false;
}
-bool EdsContactEditor::addNew(const Person* item)
+bool EdsContactEditor::addNew(Person* item)
{
- /* the const_cast is used here because the API of
- * CollectionEditor::addNew takes a const item... but in this case the
- * uid of the Person is determined by the backend, after it is saved
- * and thus needs to be set by the backend
- */
- bool ret = collection_->addNewPerson(const_cast<Person *>(item));
+ bool ret = collection_->addNewPerson(item);
if (ret) {
- items_ << const_cast<Person*>(item);
+ items_ << item;
mediator()->addItem(item);
}
return ret;