[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [KSecretService] e1565b9: Avoid the common mistake of calling
From: Michael Leupold <lemma () confuego ! org>
Date: 2010-11-09 19:14:29
Message-ID: 20101109191429.8AF7AA60EC () git ! kde ! org
[Download RAW message or body]
commit e1565b9a32e51877493205991d5fbf36e7345b92
branch master
Author: Michael Leupold <lemma@confuego.org>
Date: Sat Sep 18 14:10:49 2010 +0000
Avoid the common mistake of calling QueuedJob::start() directly instead of \
calling QueuedJob::enqueue() by making start() protected and only accessible to \
JobQueue(Private).
svn path=/trunk/playground/base/ksecretservice/; revision=1176747
diff --git a/backend/backendjob.h b/backend/backendjob.h
index 010a07c..12563ba 100644
--- a/backend/backendjob.h
+++ b/backend/backendjob.h
@@ -104,6 +104,7 @@ public:
*/
const QString &errorMessage() const;
+protected:
/**
* Default implementation for start() which just calls exec. This is
* implemented for convenience reasons as it eases the implementation of
@@ -114,7 +115,6 @@ public:
*/
virtual void start();
-protected:
/**
* Set the job result to be an error.
*
@@ -235,16 +235,17 @@ public:
virtual void exec();
/**
- * Start the job asynchronously.
- */
- virtual void start();
-
- /**
* Get the collection created by the job.
*
* @return the BackendCollection which was created or 0 on failure.
*/
BackendCollection *collection() const;
+
+protected:
+ /**
+ * Start the job asynchronously.
+ */
+ virtual void start();
private Q_SLOTS:
/**
diff --git a/backend/ksecret/ksecretjobs.h b/backend/ksecret/ksecretjobs.h
index 8bcaa84..cf5cad6 100644
--- a/backend/ksecret/ksecretjobs.h
+++ b/backend/ksecret/ksecretjobs.h
@@ -42,6 +42,8 @@ public:
KSecretCollectionManager *manager);
virtual bool isImmediate() const;
virtual void exec();
+
+protected:
virtual void start();
private Q_SLOTS:
@@ -62,6 +64,8 @@ public:
KSecretUnlockCollectionJob(KSecretCollection *coll);
virtual bool isImmediate() const;
virtual void exec();
+
+protected:
virtual void start();
private Q_SLOTS:
@@ -145,6 +149,8 @@ public:
virtual ~KSecretUnlockItemJob();
virtual bool isImmediate() const;
virtual void exec();
+
+protected:
virtual void start();
private Q_SLOTS:
@@ -166,6 +172,8 @@ public:
virtual ~KSecretLockItemJob();
virtual bool isImmediate() const;
virtual void exec();
+
+protected:
virtual void start();
private Q_SLOTS:
diff --git a/lib/queuedjob.h b/lib/queuedjob.h
index b9e5520..25f2630 100644
--- a/lib/queuedjob.h
+++ b/lib/queuedjob.h
@@ -24,6 +24,7 @@
#include <QtCore/QObject>
// forward declaration
+class JobQueuePrivate;
class JobQueue;
class QueuedJobPrivate;
@@ -86,7 +87,8 @@ public:
* as finished and call deleteLater().
*/
virtual void exec() = 0;
-
+
+protected:
/**
* Start the job asynchronously.
*
@@ -94,7 +96,6 @@ public:
*/
virtual void start() = 0;
-protected:
/**
* Emit the result of this job, notifying every object listening that
* it's finished.
@@ -113,6 +114,7 @@ Q_SIGNALS:
void result(QueuedJob *job);
private:
+ friend class JobQueuePrivate;
QueuedJobPrivate *d;
};
diff --git a/ui/dialoguimanager.h b/ui/dialoguimanager.h
index 4902787..1205631 100644
--- a/ui/dialoguimanager.h
+++ b/ui/dialoguimanager.h
@@ -42,6 +42,7 @@ public:
*/
~DialogAskPasswordJob();
+protected:
/**
* Contains the actual workload of showing the dialog.
*/
@@ -72,6 +73,7 @@ public:
*/
~DialogNewPasswordJob();
+protected:
/**
* Contains the actual workload of showing the dialog.
*/
diff --git a/ui/nouimanager.h b/ui/nouimanager.h
index ece89ac..75b41fb 100644
--- a/ui/nouimanager.h
+++ b/ui/nouimanager.h
@@ -42,6 +42,7 @@ public:
*/
virtual ~NoUiAskPasswordJob();
+protected:
/**
* Does basically nothing - no UI, no password to enter.
*/
@@ -75,6 +76,7 @@ public:
*/
virtual ~NoUiNewPasswordJob();
+protected:
/**
* Does basically nothing - no UI, no new password to enter.
*/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic