From 26b436f46f5d485c371ec5fd7876bcf2fab3c552 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 14 Sep 2023 14:04:05 +0200 Subject: [PATCH] Utils: Fix constness in AspectList functions Change-Id: I960e02e1a193856de3ed0e090fdf694884a28ac5 Reviewed-by: hjk Reviewed-by: --- src/libs/utils/aspects.cpp | 6 +++--- src/libs/utils/aspects.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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;