From db3d20e4d0f29e910b61f5749e97a0851bb56809 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 4 Nov 2009 00:21:55 +0000 Subject: [PATCH] make it assignable svn path=/trunk/KDE/kdelibs/; revision=1044541 --- runnercontext.cpp | 10 ++++++++++ runnercontext.h | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/runnercontext.cpp b/runnercontext.cpp index 729aa5fa4..a610301f4 100644 --- a/runnercontext.cpp +++ b/runnercontext.cpp @@ -249,6 +249,16 @@ RunnerContext::~RunnerContext() { } +RunnerContext &RunnerContext::operator=(const RunnerContext &other) +{ + LOCK_FOR_WRITE(this) + LOCK_FOR_READ((&other)) + d = other.d; + UNLOCK((&other)) + UNLOCK(this) + return *this; +} + void RunnerContext::reset() { // We will detach if we are a copy of someone. But we will reset diff --git a/runnercontext.h b/runnercontext.h index d862f5a22..3dd218b5b 100644 --- a/runnercontext.h +++ b/runnercontext.h @@ -67,7 +67,13 @@ class PLASMA_EXPORT RunnerContext : public QObject /** * Copy constructor */ - explicit RunnerContext(RunnerContext &other, QObject *parent = 0); + RunnerContext(RunnerContext &other, QObject *parent = 0); + + /** + * Assignment operator + * @since 4.4 + */ + RunnerContext &operator=(const RunnerContext &other); ~RunnerContext();