CorePlugin: Replace QSharedPointer with std::shared_ptr

According to https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews
QSharedPointer impl is poor and it's going to be removed from Qt 7.

Change-Id: Id64f1033ed0a640bb3f02821b3b5f99c7fa3987d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-02-01 17:49:39 +01:00
parent 536046ebb2
commit 37dd482c3b
4 changed files with 8 additions and 10 deletions

View File

@@ -6,7 +6,6 @@
#include "externaltool.h"
#include "coreconstants.h"
#include "coreplugintr.h"
#include "icontext.h"
#include "icore.h"
#include "messagemanager.h"
#include "actionmanager/actionmanager.h"
@@ -114,7 +113,7 @@ void ExternalToolManager::parseDirectory(const QString &directory,
if (isPreset) {
// preset that was changed
ExternalTool *other = tools->value(tool->id());
other->setPreset(QSharedPointer<ExternalTool>(tool));
other->setPreset(std::shared_ptr<ExternalTool>(tool));
} else {
qWarning() << Tr::tr("Error: External tool in %1 has duplicate id").arg(fileName);
delete tool;
@@ -123,7 +122,7 @@ void ExternalToolManager::parseDirectory(const QString &directory,
}
if (isPreset) {
// preset that wasn't changed --> save original values
tool->setPreset(QSharedPointer<ExternalTool>(new ExternalTool(tool)));
tool->setPreset(std::shared_ptr<ExternalTool>(new ExternalTool(tool)));
}
tools->insert(tool->id(), tool);
(*categoryMenus)[tool->displayCategory()].insert(tool->order(), tool);