ProjectExplorer: Modernize even more

Use unique_ptr for all *Private classes, except for those
in singletons.

Change-Id: Ib56c31ddedc6e9cf321f15de1f1e697a27ad4089
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Tobias Hunger
2018-07-16 13:59:39 +02:00
parent 48850dfa4d
commit 80c2ce118d
50 changed files with 130 additions and 144 deletions

View File

@@ -949,7 +949,7 @@ public:
using namespace Internal;
RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode) :
d(new RunControlPrivate(this, runConfiguration, mode))
d(std::make_unique<RunControlPrivate>(this, runConfiguration, mode))
{
#ifdef WITH_JOURNALD
JournaldWatcher::instance()->subscribe(this, [this](const JournaldWatcher::LogEntry &entry) {
@@ -981,8 +981,6 @@ RunControl::~RunControl()
#ifdef WITH_JOURNALD
JournaldWatcher::instance()->unsubscribe(this);
#endif
delete d;
d = nullptr;
}
void RunControl::initiateStart()
@@ -1009,7 +1007,7 @@ void RunControl::forceStop()
void RunControl::initiateFinish()
{
QTimer::singleShot(0, d, &RunControlPrivate::initiateFinish);
QTimer::singleShot(0, d.get(), &RunControlPrivate::initiateFinish);
}
using WorkerCreators = QHash<Core::Id, RunControl::WorkerCreator>;
@@ -1878,14 +1876,10 @@ void RunWorkerPrivate::timerEvent(QTimerEvent *ev)
*/
RunWorker::RunWorker(RunControl *runControl)
: d(new RunWorkerPrivate(this, runControl))
{
}
: d(std::make_unique<RunWorkerPrivate>(this, runControl))
{ }
RunWorker::~RunWorker()
{
delete d;
}
RunWorker::~RunWorker() = default;
/*!
* This function is called by the RunControl once all dependencies