Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a72dafa6 authored by Thomas Zander's avatar Thomas Zander

Rename getter for consistency

svn path=/trunk/koffice/; revision=1078993
parent 39116922
......@@ -58,7 +58,7 @@ void KisPaletteDocker::setCanvas(KoCanvasBase * canvas)
void KisPaletteDocker::colorSelected(const KoColor& c, bool final)
{
if (final && m_canvas) {
m_canvas->resourceProvider()->setForegroundColor(c);
m_canvas->resourceManager()->setForegroundColor(c);
}
}
......
......@@ -97,9 +97,9 @@ DigitalMixerDock::DigitalMixerDock( KisView2 *view ) : QDockWidget(i18n("Digital
void DigitalMixerDock::setCanvas(KoCanvasBase * canvas)
{
m_canvas = canvas;
connect(m_canvas->resourceProvider(), SIGNAL(resourceChanged(int, const QVariant&)),
connect(m_canvas->resourceManager(), SIGNAL(resourceChanged(int, const QVariant&)),
this, SLOT(resourceChanged(int, const QVariant&)));
setCurrentColor(m_canvas->resourceProvider()->foregroundColor());
setCurrentColor(m_canvas->resourceManager()->foregroundColor());
}
void DigitalMixerDock::popupColorChanged(int i)
......@@ -131,9 +131,8 @@ void DigitalMixerDock::setCurrentColor(const KoColor& color)
}
if (m_canvas && m_tellCanvas)
{
m_canvas->resourceProvider()->setForegroundColor(m_currentColor);
m_canvas->resourceManager()->setForegroundColor(m_currentColor);
}
}
void DigitalMixerDock::resourceChanged(int key, const QVariant& v)
......
......@@ -41,15 +41,15 @@ SmallColorSelectorDock::SmallColorSelectorDock()
void SmallColorSelectorDock::setCanvas(KoCanvasBase * canvas)
{
m_canvas = canvas;
connect(m_canvas->resourceProvider(), SIGNAL(resourceChanged(int, const QVariant&)),
connect(m_canvas->resourceManager(), SIGNAL(resourceChanged(int, const QVariant&)),
this, SLOT(resourceChanged(int, const QVariant&)));
m_smallColorWidget->setQColor(m_canvas->resourceProvider()->foregroundColor().toQColor());
m_smallColorWidget->setQColor(m_canvas->resourceManager()->foregroundColor().toQColor());
}
void SmallColorSelectorDock::colorChangedProxy(const QColor& c)
{
if (m_canvas)
m_canvas->resourceProvider()->setForegroundColor(KoColor(c , KoColorSpaceRegistry::instance()->rgb8()));
m_canvas->resourceManager()->setForegroundColor(KoColor(c , KoColorSpaceRegistry::instance()->rgb8()));
}
void SmallColorSelectorDock::resourceChanged(int key, const QVariant& v)
......
......@@ -35,16 +35,16 @@ KisTriangleColorSelectorDock::KisTriangleColorSelectorDock() : QDockWidget(i18n(
void KisTriangleColorSelectorDock::setCanvas(KoCanvasBase * canvas)
{
m_canvas = canvas;
connect(m_canvas->resourceProvider(), SIGNAL(resourceChanged(int, const QVariant&)),
connect(m_canvas->resourceManager(), SIGNAL(resourceChanged(int, const QVariant&)),
this, SLOT(resourceChanged(int, const QVariant&)));
m_colorSelector->setQColor(m_canvas->resourceProvider()->foregroundColor().toQColor());
m_colorSelector->setQColor(m_canvas->resourceManager()->foregroundColor().toQColor());
}
void KisTriangleColorSelectorDock::colorChangedProxy(const QColor& c)
{
if (m_canvas)
m_canvas->resourceProvider()->setForegroundColor(KoColor(c , KoColorSpaceRegistry::instance()->rgb8()));
m_canvas->resourceManager()->setForegroundColor(KoColor(c , KoColorSpaceRegistry::instance()->rgb8()));
}
void KisTriangleColorSelectorDock::resourceChanged(int key, const QVariant& v)
......
......@@ -108,7 +108,7 @@ void KisPainterlyMixer::slotChangeColor(int index)
void KisPainterlyMixer::setColor(const KoColor& color)
{
m_canvas->resourceProvider()->setForegroundColor(color);
m_canvas->resourceManager()->setForegroundColor(color);
}
#include "kis_painterlymixer.moc"
......@@ -53,12 +53,12 @@ QString KisPainterlyMixerDockerFactory::id() const
void KisPainterlyMixerDocker::setCanvas(KoCanvasBase* canvas)
{
m_currentCanvas = canvas;
connect(m_currentCanvas->resourceProvider(), SIGNAL(resourceChanged(int,QVariant)), this, SLOT(resourceChanged(int,QVariant)));
connect(m_currentCanvas->resourceManager(), SIGNAL(resourceChanged(int,QVariant)), this, SLOT(resourceChanged(int,QVariant)));
}
void KisPainterlyMixerDocker::colorChanged(const KoColor& color)
{
m_currentCanvas->resourceProvider()->setForegroundColor(color);
m_currentCanvas->resourceManager()->setForegroundColor(color);
}
void KisPainterlyMixerDocker::resourceChanged(int key, const QVariant& value)
......
......@@ -84,8 +84,8 @@ void MixerTool::activate(bool temporary)
m_d->mouseDown = false;
useCursor(m_d->cursor);
m_d->foregroundColor = canvas()->resourceProvider()->resource(KoCanvasResource::ForegroundColor).value<KoColor>();
m_d->backgroundColor = canvas()->resourceProvider()->resource(KoCanvasResource::BackgroundColor).value<KoColor>();
m_d->foregroundColor = canvas()->resourceManager()->resource(KoCanvasResource::ForegroundColor).value<KoColor>();
m_d->backgroundColor = canvas()->resourceManager()->resource(KoCanvasResource::BackgroundColor).value<KoColor>();
}
void MixerTool::deactivate()
......@@ -132,7 +132,7 @@ void MixerTool::mouseReleaseEvent(KoPointerEvent *event)
{
// XXX: We want to be able to set a color source for the other paintops that
// contains the impure blend under the current cursor.
m_d->mixer->resourceProvider()->setResource(KoCanvasResource::ForegroundColor, event->pos());
m_d->mixer->resourceManager()->setResource(KoCanvasResource::ForegroundColor, event->pos());
m_d->mouseDown = false;
}
......
......@@ -166,9 +166,9 @@ void KisToolColorPicker::mousePressEvent(KoPointerEvent *event)
if (m_updateColor) {
if (event->button() == Qt::LeftButton)
canvas()->resourceProvider()->setResource(KoCanvasResource::ForegroundColor, m_pickedColor);
canvas()->resourceManager()->setResource(KoCanvasResource::ForegroundColor, m_pickedColor);
else
canvas()->resourceProvider()->setResource(KoCanvasResource::BackgroundColor, m_pickedColor);
canvas()->resourceManager()->setResource(KoCanvasResource::BackgroundColor, m_pickedColor);
}
if (m_addPalette) {
......
......@@ -46,7 +46,7 @@ KisToolPath::~KisToolPath()
void KisToolPath::addPathShape()
{
KisNodeSP currentNode =
canvas()->resourceProvider()->resource(KisCanvasResourceProvider::CurrentKritaNode).value<KisNodeSP>();
canvas()->resourceManager()->resource(KisCanvasResourceProvider::CurrentKritaNode).value<KisNodeSP>();
if (!currentNode) {
delete m_shape;
m_shape = 0;
......@@ -82,7 +82,7 @@ void KisToolPath::addPathShape()
painter.setStrokeStyle(KisPainter::StrokeStyleNone);
painter.setOpacity(OPACITY_OPAQUE);
painter.setCompositeOp(dev->colorSpace()->compositeOp(COMPOSITE_OVER));
KisPaintOpPresetSP preset = canvas->resourceProvider()->
KisPaintOpPresetSP preset = canvas->resourceManager()->
resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
painter.setPaintOpPreset(preset, image);
......
......@@ -118,7 +118,7 @@ QMap<QString, QWidget *> KisToolSelectPath::createOptionWidgets()
void KisToolSelectPath::LokalTool::addPathShape()
{
KisNodeSP currentNode =
canvas()->resourceProvider()->resource(KisCanvasResourceProvider::CurrentKritaNode).value<KisNodeSP>();
canvas()->resourceManager()->resource(KisCanvasResourceProvider::CurrentKritaNode).value<KisNodeSP>();
if (!currentNode)
return;
......
......@@ -209,7 +209,7 @@ void KisToolTransform::activate(bool temporary)
}
}
currentNode() =
m_canvas->resourceProvider()->resource(KisCanvasResourceProvider::CurrentKritaNode).value<KisNodeSP>();
m_canvas->resourceManager()->resource(KisCanvasResourceProvider::CurrentKritaNode).value<KisNodeSP>();
}
void KisToolTransform::initHandles()
......
......@@ -55,20 +55,20 @@ KisCanvasResourceProvider::~KisCanvasResourceProvider()
{
}
void KisCanvasResourceProvider::setCanvasResourceProvider(KoResourceManager * resourceProvider)
void KisCanvasResourceProvider::setResourceManager(KoResourceManager *resourceManager)
{
m_resourceProvider = resourceProvider;
m_resourceManager = resourceManager;
QVariant v;
v.setValue(KoColor(Qt::black, m_view->image()->colorSpace()));
m_resourceProvider->setResource(KoCanvasResource::ForegroundColor, v);
m_resourceManager->setResource(KoCanvasResource::ForegroundColor, v);
v.setValue(KoColor(Qt::white, m_view->image()->colorSpace()));
m_resourceProvider->setResource(KoCanvasResource::BackgroundColor, v);
m_resourceManager->setResource(KoCanvasResource::BackgroundColor, v);
resetDisplayProfile();
connect(m_resourceProvider, SIGNAL(resourceChanged(int, const QVariant &)),
connect(m_resourceManager, SIGNAL(resourceChanged(int, const QVariant &)),
this, SLOT(slotResourceChanged(int, const QVariant&)));
}
......@@ -81,22 +81,22 @@ KoCanvasBase * KisCanvasResourceProvider::canvas() const
KoColor KisCanvasResourceProvider::bgColor() const
{
return m_resourceProvider->resource(KoCanvasResource::BackgroundColor).value<KoColor>();
return m_resourceManager->resource(KoCanvasResource::BackgroundColor).value<KoColor>();
}
KoColor KisCanvasResourceProvider::fgColor() const
{
return m_resourceProvider->resource(KoCanvasResource::ForegroundColor).value<KoColor>();
return m_resourceManager->resource(KoCanvasResource::ForegroundColor).value<KoColor>();
}
float KisCanvasResourceProvider::HDRExposure() const
{
return static_cast<float>(m_resourceProvider->resource(HdrExposure).toDouble());
return static_cast<float>(m_resourceManager->resource(HdrExposure).toDouble());
}
void KisCanvasResourceProvider::setHDRExposure(float exposure)
{
m_resourceProvider->setResource(HdrExposure, static_cast<double>(exposure));
m_resourceManager->setResource(HdrExposure, static_cast<double>(exposure));
KisExposureVisitor eV(exposure);
m_view->image()->projection()->colorSpace()->profile()->setProperty("exposure", exposure);
m_view->image()->rootLayer()->accept(eV);
......@@ -107,19 +107,19 @@ void KisCanvasResourceProvider::setHDRExposure(float exposure)
KisPattern * KisCanvasResourceProvider::currentPattern() const
{
return static_cast<KisPattern*>(m_resourceProvider->resource(CurrentPattern).value<void *>());
return static_cast<KisPattern*>(m_resourceManager->resource(CurrentPattern).value<void *>());
}
KisFilterConfiguration * KisCanvasResourceProvider::currentGeneratorConfiguration() const
{
return static_cast<KisFilterConfiguration*>(m_resourceProvider->
return static_cast<KisFilterConfiguration*>(m_resourceManager->
resource(CurrentGeneratorConfiguration).value<void *>());
}
KoAbstractGradient* KisCanvasResourceProvider::currentGradient() const
{
return static_cast<KoAbstractGradient*>(m_resourceProvider->resource(CurrentGradient).value<void *>());
return static_cast<KoAbstractGradient*>(m_resourceManager->resource(CurrentGradient).value<void *>());
}
......@@ -154,7 +154,7 @@ KisNodeSP KisCanvasResourceProvider::currentNode() const
KisPaintOpPresetSP KisCanvasResourceProvider::currentPreset() const
{
KisPaintOpPresetSP preset = m_resourceProvider->resource(CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
KisPaintOpPresetSP preset = m_resourceManager->resource(CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
return preset;
}
......@@ -163,7 +163,7 @@ void KisCanvasResourceProvider::slotPatternActivated(KoResource * res)
{
KisPattern * pattern = dynamic_cast<KisPattern*>(res);
QVariant v = qVariantFromValue((void *) pattern);
m_resourceProvider->setResource(CurrentPattern, v);
m_resourceManager->setResource(CurrentPattern, v);
emit sigPatternChanged(pattern);
}
......@@ -171,7 +171,7 @@ void KisCanvasResourceProvider::slotGeneratorConfigurationActivated(KisFilterCon
{
KisFilterConfiguration * generatorConfiguration = dynamic_cast<KisFilterConfiguration*>(res);
QVariant v = qVariantFromValue((void *) generatorConfiguration);
m_resourceProvider->setResource(CurrentGeneratorConfiguration, v);
m_resourceManager->setResource(CurrentGeneratorConfiguration, v);
emit sigGeneratorConfigurationChanged(generatorConfiguration);
}
......@@ -180,7 +180,7 @@ void KisCanvasResourceProvider::slotGradientActivated(KoResource *res)
KoAbstractGradient * gradient = dynamic_cast<KoAbstractGradient*>(res);
QVariant v = qVariantFromValue((void *) gradient);
m_resourceProvider->setResource(CurrentGradient, v);
m_resourceManager->setResource(CurrentGradient, v);
emit sigGradientChanged(gradient);
}
......@@ -196,7 +196,7 @@ void KisCanvasResourceProvider::slotPaintOpPresetActivated(const KisPaintOpPrese
QVariant v;
v.setValue(preset);
m_resourceProvider->setResource(CurrentPaintOpPreset, v);
m_resourceManager->setResource(CurrentPaintOpPreset, v);
emit sigPaintOpPresetChanged(preset);
}
......@@ -205,7 +205,7 @@ void KisCanvasResourceProvider::setBGColor(const KoColor& c)
QVariant v;
v.setValue(c);
m_resourceProvider->setResource(KoCanvasResource::BackgroundColor, v);
m_resourceManager->setResource(KoCanvasResource::BackgroundColor, v);
emit sigBGColorChanged(c);
}
......@@ -213,7 +213,7 @@ void KisCanvasResourceProvider::setFGColor(const KoColor& c)
{
QVariant v;
v.setValue(c);
m_resourceProvider->setResource(KoCanvasResource::ForegroundColor, v);
m_resourceManager->setResource(KoCanvasResource::ForegroundColor, v);
emit sigFGColorChanged(c);
}
......@@ -231,7 +231,7 @@ void KisCanvasResourceProvider::slotNodeActivated(const KisNodeSP node)
{
QVariant v;
v.setValue(node);
m_resourceProvider->setResource(CurrentKritaNode, v);
m_resourceManager->setResource(CurrentKritaNode, v);
emit sigNodeChanged(currentNode());
}
......@@ -243,7 +243,7 @@ void KisCanvasResourceProvider::slotImageSizeChanged()
float fh = image->height() / image->yRes();
QSizeF postscriptSize(fw, fh);
m_resourceProvider->setResource(KoCanvasResource::PageSize, postscriptSize);
m_resourceManager->setResource(KoCanvasResource::PageSize, postscriptSize);
}
}
......
......@@ -63,7 +63,7 @@ public:
KisCanvasResourceProvider(KisView2 * view);
~KisCanvasResourceProvider();
void setCanvasResourceProvider(KoResourceManager * resourceProvider);
void setResourceManager(KoResourceManager *resourceManager);
KoCanvasBase * canvas() const;
......@@ -129,7 +129,7 @@ signals:
private:
KisView2 * m_view;
KoResourceManager * m_resourceProvider;
KoResourceManager * m_resourceManager;
const KoColorProfile * m_displayProfile;
};
......
......@@ -66,8 +66,8 @@ KisSelectionDecoration::KisSelectionDecoration(KisView2* view)
// current selection now (global or local).
connect(timer, SIGNAL(timeout()), this, SLOT(selectionTimerEvent()));
KoResourceManager* resourceProvider = view->canvasBase()->resourceProvider();
connect(resourceProvider, SIGNAL(resourceChanged(int, const QVariant &)),
KoResourceManager *resourceManager = view->canvasBase()->resourceManager();
connect(resourceManager, SIGNAL(resourceChanged(int, const QVariant &)),
this, SLOT(resourceChanged(int, const QVariant&)));
}
......
......@@ -222,7 +222,7 @@ KisView2::KisView2(KisDoc2 * doc, QWidget * parent)
m_d->canvasController->setCanvas(m_d->canvas);
m_d->resourceProvider = new KisCanvasResourceProvider(this);
m_d->resourceProvider->setCanvasResourceProvider(m_d->canvas->resourceProvider());
m_d->resourceProvider->setResourceManager(m_d->canvas->resourceManager());
Q_ASSERT(m_d->canvasController);
KoToolManager::instance()->addController(m_d->canvasController);
......
......@@ -99,7 +99,7 @@ void KisZoomManager::setup(KActionCollection * actionCollection)
m_horizontalRuler->setShowMousePosition(true);
m_horizontalRuler->setUnit(KoUnit(KoUnit::Point));
m_horizontalRuler->setVisible(show);
new KoRulerController(m_horizontalRuler, m_canvasController->canvas()->resourceProvider());
new KoRulerController(m_horizontalRuler, m_canvasController->canvas()->resourceManager());
m_verticalRuler = new KoRuler(m_view, Qt::Vertical, m_zoomHandler);
m_verticalRuler->setShowMousePosition(true);
m_verticalRuler->setUnit(KoUnit(KoUnit::Point));
......
......@@ -122,26 +122,26 @@ void KisTool::activate(bool)
resetCursorStyle();
d->currentFgColor = canvas()->resourceProvider()->resource(KoCanvasResource::ForegroundColor).value<KoColor>();
d->currentBgColor = canvas()->resourceProvider()->resource(KoCanvasResource::BackgroundColor).value<KoColor>();
d->currentPattern = static_cast<KisPattern *>(canvas()->resourceProvider()->
d->currentFgColor = canvas()->resourceManager()->resource(KoCanvasResource::ForegroundColor).value<KoColor>();
d->currentBgColor = canvas()->resourceManager()->resource(KoCanvasResource::BackgroundColor).value<KoColor>();
d->currentPattern = static_cast<KisPattern *>(canvas()->resourceManager()->
resource(KisCanvasResourceProvider::CurrentPattern).value<void *>());
d->currentGradient = static_cast<KoAbstractGradient *>(canvas()->resourceProvider()->
d->currentGradient = static_cast<KoAbstractGradient *>(canvas()->resourceManager()->
resource(KisCanvasResourceProvider::CurrentGradient).value<void *>());
d->currentPaintOpPreset =
canvas()->resourceProvider()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
canvas()->resourceManager()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
if (d->currentPaintOpPreset && d->currentPaintOpPreset->settings()) {
d->currentPaintOpPreset->settings()->activate();
}
d->currentNode = canvas()->resourceProvider()->
d->currentNode = canvas()->resourceManager()->
resource(KisCanvasResourceProvider::CurrentKritaNode).value<KisNodeSP>();
d->currentExposure = static_cast<float>(canvas()->resourceProvider()->
d->currentExposure = static_cast<float>(canvas()->resourceManager()->
resource(KisCanvasResourceProvider::HdrExposure).toDouble());
d->currentGenerator = static_cast<KisFilterConfiguration*>(canvas()->resourceProvider()->
d->currentGenerator = static_cast<KisFilterConfiguration*>(canvas()->resourceManager()->
resource(KisCanvasResourceProvider::CurrentGeneratorConfiguration).value<void *>());
}
......@@ -167,7 +167,7 @@ void KisTool::resourceChanged(int key, const QVariant & v)
break;
case(KisCanvasResourceProvider::CurrentPaintOpPreset):
d->currentPaintOpPreset =
canvas()->resourceProvider()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
canvas()->resourceManager()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
break;
case(KisCanvasResourceProvider::HdrExposure):
d->currentExposure = static_cast<float>(v.toDouble());
......@@ -444,17 +444,17 @@ void KisTool::resetCursorStyle()
void KisTool::slotToggleFgBg()
{
KoResourceManager* resourceProvider = canvas()->resourceProvider();
KoColor c = resourceProvider->foregroundColor();
resourceProvider->setForegroundColor(resourceProvider->backgroundColor());
resourceProvider->setBackgroundColor(c);
KoResourceManager* resourceManager = canvas()->resourceManager();
KoColor c = resourceManager->foregroundColor();
resourceManager->setForegroundColor(resourceManager->backgroundColor());
resourceManager->setBackgroundColor(c);
}
void KisTool::slotResetFgBg()
{
KoResourceManager* resourceProvider = canvas()->resourceProvider();
resourceProvider->setForegroundColor(KoColor(Qt::black, KoColorSpaceRegistry::instance()->rgb8()));
resourceProvider->setBackgroundColor(KoColor(Qt::white, KoColorSpaceRegistry::instance()->rgb8()));
KoResourceManager* resourceManager = canvas()->resourceManager();
resourceManager->setForegroundColor(KoColor(Qt::black, KoColorSpaceRegistry::instance()->rgb8()));
resourceManager->setBackgroundColor(KoColor(Qt::white, KoColorSpaceRegistry::instance()->rgb8()));
}
bool KisTool::isCanvasOpenGL() const
......
......@@ -125,11 +125,11 @@ void KisToolFreehand::mousePressEvent(KoPointerEvent *e)
// control-click gets the color at the current point. For now, only with a ratio of 1
if (e->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) {
if (e->button() == Qt::LeftButton)
canvas()->resourceProvider()->setResource(KoCanvasResource::ForegroundColor,
canvas()->resourceManager()->setResource(KoCanvasResource::ForegroundColor,
KisToolUtils::pick(currentNode()->paintDevice(),
convertToIntPixelCoord(e)));
else
canvas()->resourceProvider()->setResource(KoCanvasResource::BackgroundColor,
canvas()->resourceManager()->setResource(KoCanvasResource::BackgroundColor,
KisToolUtils::pick(currentNode()->paintDevice(),
convertToIntPixelCoord(e)));
......@@ -137,11 +137,11 @@ void KisToolFreehand::mousePressEvent(KoPointerEvent *e)
else if (e->modifiers() == Qt::ControlModifier ) {
if (e->button() == Qt::LeftButton)
canvas()->resourceProvider()->setResource(KoCanvasResource::ForegroundColor,
canvas()->resourceManager()->setResource(KoCanvasResource::ForegroundColor,
KisToolUtils::pick(currentImage()->mergedImage(),
convertToIntPixelCoord(e)));
else
canvas()->resourceProvider()->setResource(KoCanvasResource::BackgroundColor,
canvas()->resourceManager()->setResource(KoCanvasResource::BackgroundColor,
KisToolUtils::pick(currentImage()->mergedImage(),
convertToIntPixelCoord(e)));
}
......
......@@ -33,14 +33,14 @@
class KoCanvasBase::Private
{
public:
Private() : shapeController(0), resourceProvider(0), controller(0) {}
Private() : shapeController(0), resourceManager(0), controller(0) {}
~Private() {
delete shapeController;
delete resourceProvider;
delete resourceManager;
delete snapGuide;
}
KoShapeController *shapeController;
KoResourceManager * resourceProvider;
KoResourceManager * resourceManager;
KoCanvasController *controller;
KoSnapGuide * snapGuide;
};
......@@ -48,7 +48,7 @@ public:
KoCanvasBase::KoCanvasBase(KoShapeControllerBase *shapeControllerBase)
: d(new Private())
{
d->resourceProvider = new KoResourceManager();
d->resourceManager = new KoResourceManager();
d->shapeController = new KoShapeController(this, shapeControllerBase);
d->snapGuide = new KoSnapGuide(this);
}
......@@ -64,9 +64,9 @@ KoShapeController *KoCanvasBase::shapeController() const
return d->shapeController;
}
KoResourceManager *KoCanvasBase::resourceProvider() const
KoResourceManager *KoCanvasBase::resourceManager() const
{
return d->resourceProvider;
return d->resourceManager;
}
void KoCanvasBase::ensureVisible(const QRectF &rect)
......
......@@ -160,11 +160,11 @@ public:
virtual void updateInputMethodInfo() = 0;
/**
* Return a pointer to the resource provider associated with this
* canvas. The resource provider contains per-canvas settings such
* Return a pointer to the resource manager associated with this
* canvas. The resource manager contains per-canvas settings such
* as current foreground and background color.
*/
KoResourceManager *resourceProvider() const;
KoResourceManager *resourceManager() const;
/**
* Return the shape controller for this canvas.
......
......@@ -20,7 +20,7 @@
#include "KoShapeConfigWidgetBase.h"
KoShapeConfigWidgetBase::KoShapeConfigWidgetBase()
: m_resourceProvider(0)
: m_resourceManager(0)
{
}
......@@ -35,7 +35,7 @@ void KoShapeConfigWidgetBase::setUnit(KoUnit unit)
void KoShapeConfigWidgetBase::setResourceProvider(KoResourceManager* provider)
{
m_resourceProvider = provider;
m_resourceManager = provider;
}
bool KoShapeConfigWidgetBase::showOnShapeCreate()
......
......@@ -93,7 +93,7 @@ signals:
void propertyChanged();
protected:
KoResourceManager *m_resourceProvider; ///< the resource provider with data for this canvas
KoResourceManager *m_resourceManager; ///< the resource provider with data for this canvas
};
#endif
......@@ -73,7 +73,7 @@ public:
continue;
}
widgets.append(widget);
widget->setResourceProvider(canvas->resourceProvider());
widget->setResourceProvider(canvas->resourceManager());
widget->setUnit(canvas->unit());
dialog->addPage(widget, panelFactory->name());
pageCount ++;
......@@ -83,7 +83,7 @@ public:
continue;
panel->open(shape);
widgets.append(panel);
panel->setResourceProvider(canvas->resourceProvider());
panel->setResourceProvider(canvas->resourceManager());
panel->setUnit(canvas->unit());
QString title = panel->windowTitle().isEmpty() ? panel->objectName() : panel->windowTitle();
dialog->addPage(panel, title);
......
......@@ -33,10 +33,10 @@ KoTool::KoTool(KoCanvasBase *canvas)
{
Q_D(KoTool);
if (d->canvas) { // in the case of KoToolManagers dummytool it can be zero :(
KoResourceManager * crp = d->canvas->resourceProvider();
KoResourceManager * crp = d->canvas->resourceManager();
Q_ASSERT_X(crp, "KoTool::KoTool", "No KoResourceManager");
if (crp)
connect(d->canvas->resourceProvider(), SIGNAL(resourceChanged(int, const QVariant &)),
connect(d->canvas->resourceManager(), SIGNAL(resourceChanged(int, const QVariant &)),
this, SLOT(resourceChanged(int, const QVariant &)));
}
}
......@@ -237,7 +237,7 @@ QRectF KoTool::handleGrabRect(const QPointF &position)
{
Q_D(KoTool);
const KoViewConverter * converter = d->canvas->viewConverter();
uint handleSize = 2*d->canvas->resourceProvider()->grabSensitivity();
uint handleSize = 2*d->canvas->resourceManager()->grabSensitivity();
QRectF r = converter->viewToDocument(QRectF(0, 0, handleSize, handleSize));
r.moveCenter(position);
return r;
......@@ -247,7 +247,7 @@ QRectF KoTool::handlePaintRect(const QPointF &position)
{
Q_D(KoTool);
const KoViewConverter * converter = d->canvas->viewConverter();
uint handleSize = 2*d->canvas->resourceProvider()->handleRadius();
uint handleSize = 2*d->canvas->resourceManager()->handleRadius();
QRectF r = converter->viewToDocument(QRectF(0, 0, handleSize, handleSize));
r.moveCenter(position);
return r;
......
......@@ -238,8 +238,8 @@ void KoCreatePathTool::mousePressEvent(KoPointerEvent *event)
} else {
m_shape = new KoPathShape();
m_shape->setShapeId(KoPathShapeId);
KoLineBorder * border = new KoLineBorder(m_canvas->resourceProvider()->activeBorder());
border->setColor(m_canvas->resourceProvider()->foregroundColor().toQColor());
KoLineBorder * border = new KoLineBorder(m_canvas->resourceManager()->activeBorder());
border->setColor(m_canvas->resourceManager()->foregroundColor().toQColor());
m_shape->setBorder(border);
m_canvas->updateCanvas(m_canvas->snapGuide()->boundingRect());
QPointF point = m_canvas->snapGuide()->snap(event->point, event->modifiers());
......@@ -362,7 +362,7 @@ void KoCreatePathTool::activate(bool temporary)
useCursor(Qt::ArrowCursor);
// retrieve the actual global handle radius
m_handleRadius = m_canvas->resourceProvider()->handleRadius();
m_handleRadius = m_canvas->resourceManager()->handleRadius();
// reset snap guide
m_canvas->updateCanvas(m_canvas->snapGuide()->boundingRect());
......@@ -510,7 +510,7 @@ KoPathPoint* KoCreatePathTool::endPointAtPosition( const QPointF &position )
KoPathPoint * nearestPoint = 0;
qreal minDistance = HUGE_VAL;
uint grabSensitivity = m_canvas->resourceProvider()->grabSensitivity();
uint grabSensitivity = m_canvas->resourceManager()->grabSensitivity();
qreal maxDistance = m_canvas->viewConverter()->viewToDocumentX(grabSensitivity);
foreach(KoShape *shape, shapes) {
......
......@@ -656,12 +656,12 @@ void KoPathTool::keyPressEvent(QKeyEvent *event)
switch (event->key()) {
// TODO move these to the actions in the constructor.
case Qt::Key_I: {
int