Commit 77688782 authored by Thomas Zander's avatar Thomas Zander

Also alter contructor of KoToolFactory like I did on KoShapeFactory

svn path=/trunk/koffice/; revision=550999
parent e4902926
......@@ -28,8 +28,8 @@
#include <QRectF>
#include <QPixmap>
KoCreateShapesToolFactory::KoCreateShapesToolFactory()
: KoToolFactory(KoCreateShapesTool_ID, i18n("Create Shapes"))
KoCreateShapesToolFactory::KoCreateShapesToolFactory(QObject *parent, const QStringList&)
: KoToolFactory(parent, KoCreateShapesTool_ID, i18n("Create Shapes"))
{
setToolTip(i18n("Create object"));
setToolType("main");
......
......@@ -29,7 +29,7 @@
class FLAKE_EXPORT KoCreateShapesToolFactory : public KoToolFactory {
public:
/// Constructor
KoCreateShapesToolFactory();
KoCreateShapesToolFactory(QObject *parent, const QStringList&);
/// Destructor
~KoCreateShapesToolFactory();
......
......@@ -25,8 +25,8 @@
#include <QPixmap>
KoInteractionToolFactory::KoInteractionToolFactory()
: KoToolFactory(KoInteractionTool_ID, i18n("Default Tool"))
KoInteractionToolFactory::KoInteractionToolFactory(QObject *parent, const QStringList&)
: KoToolFactory(parent, KoInteractionTool_ID, i18n("Default Tool"))
{
setToolTip(i18n("Default tool"));
setToolType("main");
......
......@@ -29,7 +29,7 @@
class FLAKE_EXPORT KoInteractionToolFactory : public KoToolFactory {
public:
/// constructor
KoInteractionToolFactory();
KoInteractionToolFactory(QObject *parent, const QStringList&);
~KoInteractionToolFactory();
KoTool* createTool(KoCanvasBase *canvas);
......
......@@ -18,12 +18,12 @@
#include "KoToolFactory.h"
KoToolFactory::KoToolFactory(const QString id, const QString name)
: m_name(name)
KoToolFactory::KoToolFactory(QObject *parent, const QString id, const QString name)
: QObject(parent)
, m_name(name)
, m_id(id)
{
m_priority=100;
m_activationId=-1;
}
KoToolFactory::~KoToolFactory()
......@@ -50,10 +50,14 @@ const QPixmap& KoToolFactory::icon() const {
return m_icon;
}
int KoToolFactory::activationShapeId() const {
const QString &KoToolFactory::activationShapeId() const {
return m_activationId;
}
void KoToolFactory::setActivationShapeID(const QString &activationShapeId) {
m_activationId = activationShapeId;
}
void KoToolFactory::setToolTip(const QString & tooltip) {
m_tooltip = tooltip;
}
......
......@@ -38,7 +38,7 @@ class FLAKE_EXPORT KoToolFactory : public QObject {
Q_OBJECT
public:
KoToolFactory(const QString id, const QString name);
KoToolFactory(QObject *parent, const QString id, const QString name);
virtual ~KoToolFactory();
/// instanciate a new tool
......@@ -59,7 +59,7 @@ public:
/// return an icon for this tool
const QPixmap& icon() const;
/// The shape ID the tool is associated with, or 0 when the tool is a generic tool
int activationShapeId() const;
const QString &activationShapeId() const;
protected:
/**
......@@ -70,13 +70,15 @@ protected:
void setToolType(const QString & toolType);
void setIcon(const QPixmap & icon);
void setPriority(int newPriority);
void setActivationShapeID(const QString &activationShapeId);
private:
QString m_toolType;
QString m_tooltip;
QString m_activationId;
QPixmap m_icon;
const QString m_name, m_id;
int m_priority, m_activationId;
int m_priority;
};
#endif
......
......@@ -67,8 +67,8 @@ void KoToolManager::setup() {
return;
}
// add defaults
m_tools.append( new ToolHelper(new KoCreateShapesToolFactory()) );
m_defaultTool = new ToolHelper(new KoInteractionToolFactory());
m_tools.append( new ToolHelper(new KoCreateShapesToolFactory(this, QStringList())) );
m_defaultTool = new ToolHelper(new KoInteractionToolFactory(this, QStringList()));
m_tools.append(m_defaultTool);
KoToolRegistry *registry = KoToolRegistry::instance();
......
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