forked from qt-creator/qt-creator
McuSupport: Auto manage memory of McuPackage's version detector
Use smart pointer for member of McuPackage. Change-Id: I2474fc791b91c489be77aee3aab86401aaef76e8 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "mcuabstractpackage.h"
|
||||
#include "mcusupportversiondetection.h"
|
||||
#include "settingshandler.h"
|
||||
|
||||
#include <utils/filepath.h>
|
||||
@@ -102,7 +103,7 @@ private:
|
||||
const Utils::FilePath m_defaultPath;
|
||||
const Utils::FilePath m_detectionPath;
|
||||
const QString m_settingsKey;
|
||||
const McuPackageVersionDetector *m_versionDetector;
|
||||
QScopedPointer<const McuPackageVersionDetector> m_versionDetector;
|
||||
|
||||
Utils::FilePath m_path;
|
||||
Utils::FilePath m_relativePathModifier; // relative path to m_path to be returned by path()
|
||||
|
||||
@@ -26,14 +26,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <utils/filepath.h>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
namespace McuSupport {
|
||||
namespace Internal {
|
||||
namespace McuSupport::Internal {
|
||||
|
||||
class McuPackageVersionDetector : public QObject
|
||||
class McuPackageVersionDetector
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
McuPackageVersionDetector();
|
||||
virtual ~McuPackageVersionDetector() = default;
|
||||
@@ -98,5 +96,4 @@ private:
|
||||
const QString m_versionRegExp;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace McuSupport
|
||||
} // namespace McuSupport::Internal
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "mcuhelpers.h"
|
||||
#include "mcupackage.h"
|
||||
#include "mcusupportconstants.h"
|
||||
#include "mcusupportversiondetection.h"
|
||||
#include "mcutarget.h"
|
||||
#include "mcutargetdescription.h"
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "mcusupportconstants.h"
|
||||
#include "mcusupportoptions.h"
|
||||
#include "mcusupportsdk.h"
|
||||
#include "mcusupportversiondetection.h"
|
||||
#include "mcutargetdescription.h"
|
||||
#include "mcutargetfactorylegacy.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user