Commit b4e844e5 authored by Halla Rempt's avatar Halla Rempt
Browse files

Another attempt at fixing the current preset settings problem

parent 13f96a12
......@@ -73,7 +73,6 @@ struct KisTool::Private {
Private()
: currentPattern(0),
currentGradient(0),
currentPaintOpPreset(0),
currentGenerator(0),
optionWidget(0),
spacePressed(0),
......@@ -89,7 +88,6 @@ struct KisTool::Private {
KoAbstractGradient * currentGradient;
KoColor currentFgColor;
KoColor currentBgColor;
KisPaintOpPresetSP currentPaintOpPreset;
KisNodeSP currentNode;
float currentExposure;
KisFilterConfiguration * currentGenerator;
......@@ -172,12 +170,7 @@ void KisTool::activate(ToolActivation, const QSet<KoShape*> &)
resource(KisCanvasResourceProvider::CurrentGradient).value<void *>());
d->currentPaintOpPreset =
canvas()->resourceManager()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
if (d->currentPaintOpPreset && d->currentPaintOpPreset->settings()) {
d->currentPaintOpPreset->settings()->activate();
}
canvas()->resourceManager()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>()->settings()->activate();
d->currentNode = canvas()->resourceManager()->
resource(KisCanvasResourceProvider::CurrentKritaNode).value<KisNodeSP>();
......@@ -234,10 +227,6 @@ void KisTool::canvasResourceChanged(int key, const QVariant & v)
case(KisCanvasResourceProvider::CurrentGradient):
d->currentGradient = static_cast<KoAbstractGradient *>(v.value<void *>());
break;
case(KisCanvasResourceProvider::CurrentPaintOpPreset):
d->currentPaintOpPreset =
canvas()->resourceManager()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
break;
case(KisCanvasResourceProvider::HdrExposure):
d->currentExposure = static_cast<float>(v.toDouble());
break;
......@@ -414,7 +403,7 @@ KoAbstractGradient * KisTool::currentGradient()
KisPaintOpPresetSP KisTool::currentPaintOpPreset()
{
return d->currentPaintOpPreset;
return canvas()->resourceManager()->resource(KisCanvasResourceProvider::CurrentPaintOpPreset).value<KisPaintOpPresetSP>();
}
KisNodeSP KisTool::currentNode()
......
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