Commit ee759782 authored by Thomas Zander's avatar Thomas Zander
Browse files

Since we only install KoAction.h, don't include KoJobsListPolicy.h

as that will create problems in usage.

svn path=/trunk/koffice/; revision=599861
parent 9f310c48
......@@ -16,10 +16,13 @@
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KoJobsListPolicy.h"
#include "KoAction.h"
#include "KoExecutePolicy.h"
#include "ActionJob_p.h"
#include <WeaverInterface.h>
#include <QVariant>
KoAction::KoAction(QObject *parent)
......@@ -28,6 +31,11 @@ KoAction::KoAction(QObject *parent)
m_weaver(0),
m_enabled(true)
{
m_jobsQueue = new KoJobsListPolicy();
}
KoAction::~KoAction() {
delete m_jobsQueue;
m_jobsQueue = 0;
}
void KoAction::execute() {
......@@ -38,7 +46,7 @@ void KoAction::execute(QVariant *params) {
if(!m_enabled)
return;
Q_ASSERT(m_weaver);
m_policy->schedule(this, &m_jobsQueue, params);
m_policy->schedule(this, m_jobsQueue, params);
}
void KoAction::doAction(QVariant *params) {
......@@ -59,4 +67,8 @@ void KoAction::doActionUi(QVariant *params) {
}
}
int KoAction::jobCount() {
return m_jobsQueue->count();
}
#include "KoAction.moc"
......@@ -19,13 +19,13 @@
#ifndef TW_ACTION_H
#define TW_ACTION_H
#include "KoJobsListPolicy.h"
#include <WeaverInterface.h>
#include <koffice_export.h>
class KoExecutePolicy;
class DirectPolicy;
class KoJobsListPolicy;
/**
* This class represent the glue between a user event and a piece of controlling logic.
......@@ -57,10 +57,11 @@ class KOFFICECORE_EXPORT KoAction : public QObject {
public:
/**
* Create a new Action object.
* The action will start with a SimpleQueuedPolicy.
* @param parent the parent QObject, for memory mangement purposes.
*/
KoAction(QObject *parent = 0);
virtual ~KoAction() {}
virtual ~KoAction();
/**
* Set a ThreadWeaver on this action which is used to execute the action in a
......@@ -94,7 +95,7 @@ public:
/**
* Return te amount of executes there are still to finish.
*/
int jobCount() { return m_jobsQueue.count(); }
int jobCount();
signals:
/**
......@@ -136,7 +137,7 @@ private:
KoExecutePolicy *m_policy;
ThreadWeaver::WeaverInterface *m_weaver;
bool m_enabled;
KoJobsListPolicy m_jobsQueue;
KoJobsListPolicy *m_jobsQueue;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment