diff --git a/src/libs/utils/aspects.cpp b/src/libs/utils/aspects.cpp index 27f8df50b3e..b5669908486 100644 --- a/src/libs/utils/aspects.cpp +++ b/src/libs/utils/aspects.cpp @@ -3089,7 +3089,7 @@ QList> AspectList::volatileItems() const return d->volatileItems; } -std::shared_ptr AspectList::addItem(std::shared_ptr item) +std::shared_ptr AspectList::addItem(const std::shared_ptr &item) { if (undoStack()) pushUndo(new AddItemCommand(this, item)); @@ -3099,7 +3099,7 @@ std::shared_ptr AspectList::addItem(std::shared_ptr item return item; } -void AspectList::actualRemoveItem(std::shared_ptr item) +void AspectList::actualRemoveItem(const std::shared_ptr &item) { d->volatileItems.removeOne(item); if (d->itemRemoved) @@ -3109,7 +3109,7 @@ void AspectList::actualRemoveItem(std::shared_ptr item) d->items = d->volatileItems; } -void AspectList::removeItem(std::shared_ptr item) +void AspectList::removeItem(const std::shared_ptr &item) { if (undoStack()) pushUndo(new RemoveItemCommand(this, item)); diff --git a/src/libs/utils/aspects.h b/src/libs/utils/aspects.h index 79f7b460847..d07be7bcb77 100644 --- a/src/libs/utils/aspects.h +++ b/src/libs/utils/aspects.h @@ -1013,11 +1013,11 @@ public: QList> items() const; QList> volatileItems() const; - std::shared_ptr addItem(std::shared_ptr item); + std::shared_ptr addItem(const std::shared_ptr &item); std::shared_ptr actualAddItem(const std::shared_ptr &item); - void removeItem(std::shared_ptr item); - void actualRemoveItem(std::shared_ptr item); + void removeItem(const std::shared_ptr &item); + void actualRemoveItem(const std::shared_ptr &item); void apply() override;