summaryrefslogtreecommitdiff
path: root/src/lib/corelib/api
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-05-10 01:25:19 -0700
committerJake Petroules <jake.petroules@qt.io>2017-05-23 16:50:08 +0000
commit20149803a44856ea25063077964c1159b6d7a078 (patch)
tree4cd0b818e1fbe5861095d7acd516451322570bc6 /src/lib/corelib/api
parent41595d0cf8ac00416a3a8a437eedde2715f75500 (diff)
downloadqbs-20149803a44856ea25063077964c1159b6d7a078.tar.gz
Replace QSharedPointer/QWeakPointer with std::shared_ptr/std::weak_ptr
Change-Id: I2915c578968bed425a8d8b617b56df88ed3f2882 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/api')
-rw-r--r--src/lib/corelib/api/internaljobs.cpp8
-rw-r--r--src/lib/corelib/api/jobs.cpp2
-rw-r--r--src/lib/corelib/api/project.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/corelib/api/internaljobs.cpp b/src/lib/corelib/api/internaljobs.cpp
index 349d93834..54ce7bfe1 100644
--- a/src/lib/corelib/api/internaljobs.cpp
+++ b/src/lib/corelib/api/internaljobs.cpp
@@ -248,7 +248,7 @@ void InternalSetupProjectJob::start()
const QString buildDir
= TopLevelProject::deriveBuildDirectory(m_parameters.buildRoot(), projectId);
if (m_existingProject && m_existingProject->buildDirectory != buildDir)
- m_existingProject.clear();
+ m_existingProject.reset();
if (!m_existingProject) {
bgLocker = new BuildGraphLocker(ProjectBuildData::deriveBuildGraphFilePath(buildDir,
projectId),
@@ -261,7 +261,7 @@ void InternalSetupProjectJob::start()
m_newProject->bgLocker = bgLocker;
deleteLocker = false;
} catch (const ErrorInfo &error) {
- m_newProject.clear();
+ m_newProject.reset();
setError(error);
// Delete the build graph locker if and only if we allocated it here.
@@ -303,7 +303,7 @@ void InternalSetupProjectJob::execute()
storeBuildGraph(m_newProject);
// The evalutation context cannot be re-used for building, which runs in a different thread.
- m_newProject->buildData->evaluationContext.clear();
+ m_newProject->buildData->evaluationContext.reset();
}
void InternalSetupProjectJob::resolveProjectFromScratch(ScriptEngine *engine)
@@ -386,7 +386,7 @@ void InternalBuildJob::build(const TopLevelProjectPtr &project,
void InternalBuildJob::handleFinished()
{
setError(m_executor->error());
- project()->buildData->evaluationContext.clear();
+ project()->buildData->evaluationContext.reset();
storeBuildGraph();
m_executor->deleteLater();
}
diff --git a/src/lib/corelib/api/jobs.cpp b/src/lib/corelib/api/jobs.cpp
index b1b5b7e5f..76c1484cf 100644
--- a/src/lib/corelib/api/jobs.cpp
+++ b/src/lib/corelib/api/jobs.cpp
@@ -268,7 +268,7 @@ void SetupProjectJob::finish()
// already transferred.
if (m_existingProject.isValid()
&& (!error().hasError() || !m_existingProject.d->internalProject->buildData)) {
- m_existingProject.d->internalProject.clear();
+ m_existingProject.d->internalProject.reset();
}
}
diff --git a/src/lib/corelib/api/project.cpp b/src/lib/corelib/api/project.cpp
index 7d8a3c12d..017db6f42 100644
--- a/src/lib/corelib/api/project.cpp
+++ b/src/lib/corelib/api/project.cpp
@@ -733,14 +733,14 @@ RuleCommandList ProjectPrivate::ruleCommands(const ProductData &product,
case AbstractCommand::JavaScriptCommandType: {
externalCommand.d->type = RuleCommand::JavaScriptCommandType;
const JavaScriptCommandPtr &jsCmd
- = internalCommand.staticCast<JavaScriptCommand>();
+ = std::static_pointer_cast<JavaScriptCommand>(internalCommand);
externalCommand.d->sourceCode = jsCmd->sourceCode();
break;
}
case AbstractCommand::ProcessCommandType: {
externalCommand.d->type = RuleCommand::ProcessCommandType;
const ProcessCommandPtr &procCmd
- = internalCommand.staticCast<ProcessCommand>();
+ = std::static_pointer_cast<ProcessCommand>(internalCommand);
externalCommand.d->executable = procCmd->program();
externalCommand.d->arguments = procCmd->arguments();
externalCommand.d->workingDir = procCmd->workingDir();