Commit b0ad3614 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remove the unused paint device parameter from KisFilter::factoryConfiguration()

parent 6ac34fe5
......@@ -68,7 +68,7 @@ void KisBContrastBenchmark::cleanupTestCase()
void KisBContrastBenchmark::benchmarkFilter()
{
KisFilterSP filter = KisFilterRegistry::instance()->value("brightnesscontrast");
KisFilterConfigurationSP kfc = filter->defaultConfiguration(m_device);
KisFilterConfigurationSP kfc = filter->defaultConfiguration();
// Get the predefined configuration from a file
QFile file(QString(FILES_DATA_DIR) + QDir::separator() + filter->id() + ".cfg");
......
......@@ -66,7 +66,7 @@ void KisBlurBenchmark::cleanupTestCase()
void KisBlurBenchmark::benchmarkFilter()
{
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
KisFilterConfigurationSP kfc = filter->defaultConfiguration(m_device);
KisFilterConfigurationSP kfc = filter->defaultConfiguration();
// Get the predefined configuration from a file
QFile file(QString(FILES_DATA_DIR) + QDir::separator() + filter->id() + ".cfg");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
......
......@@ -106,7 +106,7 @@ void KisFilterSelectionsBenchmark::initFilter(const QString &name)
{
m_filter = KisFilterRegistry::instance()->value(name);
Q_ASSERT(m_filter);
m_configuration = m_filter->defaultConfiguration(0);
m_configuration = m_filter->defaultConfiguration();
dbgKrita << "Filter initialized:" << name;
}
......
......@@ -72,10 +72,10 @@ private:
if (m_useGeneratorRegistry) {
KisGeneratorSP generator = KisGeneratorRegistry::instance()->value(name);
config = generator->defaultConfiguration(KisPaintDeviceSP());
config = generator->defaultConfiguration();
} else {
KisFilterSP filter = KisFilterRegistry::instance()->value(name);
config = filter->defaultConfiguration(KisPaintDeviceSP());
config = filter->defaultConfiguration();
}
config->fromXML(data);
......
......@@ -82,7 +82,7 @@ void KisColorTransformationFilter::processImpl(KisPaintDeviceSP device,
}
KisFilterConfigurationSP KisColorTransformationFilter::factoryConfiguration(const KisPaintDeviceSP) const
KisFilterConfigurationSP KisColorTransformationFilter::factoryConfiguration() const
{
return new KisColorTransformationConfiguration(id(), 0);
}
......@@ -42,7 +42,7 @@ public:
*/
virtual KoColorTransformation* createTransformation(const KoColorSpace* cs, const KisFilterConfigurationSP config) const = 0;
virtual KisFilterConfigurationSP factoryConfiguration(const KisPaintDeviceSP) const;
virtual KisFilterConfigurationSP factoryConfiguration() const;
};
#endif
......@@ -74,7 +74,7 @@ KisFilterConfigurationSP KisFilterRegistry::cloneConfiguration(const KisFilterCo
{
Q_ASSERT(kfc);
KisFilterSP filter = value(kfc->name());
KisFilterConfigurationSP newkfc(filter->defaultConfiguration(KisPaintDeviceSP()));
KisFilterConfigurationSP newkfc(filter->defaultConfiguration());
newkfc->fromXML(kfc->toXML());
return newkfc;
}
......
......@@ -73,7 +73,7 @@ void KisGeneratorRegistry::add(const QString &id, KisGeneratorSP item)
KisFilterConfigurationSP KisGeneratorRegistry::cloneConfiguration(const KisFilterConfigurationSP kfc)
{
KisGeneratorSP filter = value(kfc->name());
KisFilterConfigurationSP newkfc(filter->defaultConfiguration(KisPaintDeviceSP()));
KisFilterConfigurationSP newkfc(filter->defaultConfiguration());
newkfc->fromXML(kfc->toXML());
return newkfc;
}
......
......@@ -32,10 +32,10 @@ public:
KisBaseProcessorConfigurationFactory(KisBaseProcessor* _generator) : m_generator(_generator) {}
~KisBaseProcessorConfigurationFactory() override {}
KisSerializableConfigurationSP createDefault() override {
return m_generator->factoryConfiguration(KisPaintDeviceSP());
return m_generator->factoryConfiguration();
}
KisSerializableConfigurationSP create(const QDomElement& e) override {
KisSerializableConfigurationSP config = m_generator->factoryConfiguration(KisPaintDeviceSP());
KisSerializableConfigurationSP config = m_generator->factoryConfiguration();
config->fromXML(e);
return config;
}
......@@ -85,21 +85,14 @@ KisBaseProcessor::~KisBaseProcessor()
delete d;
}
KisFilterConfigurationSP KisBaseProcessor::factoryConfiguration(const KisPaintDeviceSP) const
KisFilterConfigurationSP KisBaseProcessor::factoryConfiguration() const
{
return new KisFilterConfiguration(id(), 0);
}
KisFilterConfigurationSP KisBaseProcessor::defaultConfiguration(const KisPaintDeviceSP pd) const
KisFilterConfigurationSP KisBaseProcessor::defaultConfiguration() const
{
KisFilterConfigurationSP fc = 0;
// if (bookmarkManager()) {
// fc = dynamic_cast<KisFilterConfiguration*>(bookmarkManager()->defaultConfiguration());
// }
if (!fc || !fc->isCompatible(pd)) {
fc = factoryConfiguration(pd);
}
return fc;
return factoryConfiguration();
}
KisConfigWidget * KisBaseProcessor::createConfigurationWidget(QWidget *, const KisPaintDeviceSP) const
......
......@@ -72,7 +72,7 @@ public:
*
* @return the default configuration of this widget
*/
KisFilterConfigurationSP defaultConfiguration(const KisPaintDeviceSP) const;
KisFilterConfigurationSP defaultConfiguration() const;
/**
* @return the bookmark manager for this processor
......@@ -139,7 +139,7 @@ public:
ColorSpaceIndependence colorSpaceIndependence() const;
/// @return the default configuration as defined by whoever wrote the plugin
virtual KisFilterConfigurationSP factoryConfiguration(const KisPaintDeviceSP) const;
virtual KisFilterConfigurationSP factoryConfiguration() const;
protected:
......
......@@ -86,7 +86,7 @@ bool KisColorSpaceConvertVisitor::visit(KisAdjustmentLayer * layer)
// XXX: Make this more generic for after 1.6, when we'll have many
// channel-specific filters.
KisFilterSP f = KisFilterRegistry::instance()->value("perchannel");
layer->setFilter(f->defaultConfiguration(0));
layer->setFilter(f->defaultConfiguration());
}
layer->resetCache();
......
......@@ -47,7 +47,7 @@ struct Q_DECL_HIDDEN KisRecordedFilterAction::Private {
KisFilterConfigurationSP configuration() {
if (!filterConfiguration) {
filterConfiguration = filter->defaultConfiguration(0);
filterConfiguration = filter->defaultConfiguration();
if (filterConfiguration) {
filterConfiguration->fromXML(configstr);
}
......@@ -162,7 +162,7 @@ KisRecordedAction* KisRecordedFilterActionFactory::fromXML(const QDomElement& el
KisNodeQueryPath pathnode = KisNodeQueryPath::fromString(elt.attribute("path"));
const KisFilterSP filter = KisFilterRegistry::instance()->get(elt.attribute("filter"));
if (filter) {
KisFilterConfigurationSP config = filter->defaultConfiguration(0);
KisFilterConfigurationSP config = filter->defaultConfiguration();
QDomElement paramsElt = elt.firstChildElement("Params");
if (config && !paramsElt.isNull()) {
config->fromXML(paramsElt);
......
......@@ -391,7 +391,7 @@ void KisRecordedPaintActionFactory::setupPaintAction(KisRecordedPaintAction* act
KisFilterConfigurationSP config = 0;
if (g)
{
config = g->defaultConfiguration(0);
config = g->defaultConfiguration();
QDomElement paramsElt = elt.firstChildElement("Generator");
if (config && !paramsElt.isNull()) {
config->fromXML(paramsElt);
......
......@@ -41,7 +41,7 @@ void KisAdjustmentLayerTest::testCreation()
KisImageSP image = new KisImage(0, 512, 512, colorSpace, "adj layer test");
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
KisAdjustmentLayerSP test = new KisAdjustmentLayer(image, "test", kfc, 0);
......@@ -54,7 +54,7 @@ void KisAdjustmentLayerTest::testSetSelection()
KisImageSP image = new KisImage(0, 512, 512, colorSpace, "adj layer test");
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
sel->pixelSelection()->select(QRect(10, 10, 200, 200), 128);
KisAdjustmentLayerSP l1 = new KisAdjustmentLayer(image, "bla", kfc, sel);
......@@ -67,7 +67,7 @@ void KisAdjustmentLayerTest::testInverted()
KisImageSP image = new KisImage(0, 512, 512, colorSpace, "adj layer test");
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
KisSelectionSP sel2 = new KisSelection();
......@@ -90,7 +90,7 @@ void KisAdjustmentLayerTest::testSelectionParent()
{
KisAdjustmentLayerSP adjLayer =
new KisAdjustmentLayer(image, "bla", f->defaultConfiguration(0), 0);
new KisAdjustmentLayer(image, "bla", f->defaultConfiguration(), 0);
QCOMPARE(adjLayer->internalSelection()->parentNode(), KisNodeWSP(adjLayer));
}
......@@ -98,14 +98,14 @@ void KisAdjustmentLayerTest::testSelectionParent()
{
KisSelectionSP selection = new KisSelection();
KisAdjustmentLayerSP adjLayer =
new KisAdjustmentLayer(image, "bla", f->defaultConfiguration(0), selection);
new KisAdjustmentLayer(image, "bla", f->defaultConfiguration(), selection);
QCOMPARE(adjLayer->internalSelection()->parentNode(), KisNodeWSP(adjLayer));
}
{
KisAdjustmentLayerSP adjLayer =
new KisAdjustmentLayer(image, "bla", f->defaultConfiguration(0), 0);
new KisAdjustmentLayer(image, "bla", f->defaultConfiguration(), 0);
KisSelectionSP selection = new KisSelection();
adjLayer->setInternalSelection(selection);
......
......@@ -62,7 +62,7 @@ void KisFilterMaskTest::testProjectionNotSelected()
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
KisFilterMaskSP mask = new KisFilterMask();
......@@ -98,7 +98,7 @@ void KisFilterMaskTest::testProjectionSelected()
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
KisFilterMaskSP mask = new KisFilterMask();
......
......@@ -71,7 +71,7 @@ void KisFilterTest::testWithProgressUpdater()
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
f->process(dev, QRect(QPoint(0,0), qimage.size()), kfc, updater);
......@@ -97,7 +97,7 @@ void KisFilterTest::testSingleThreaded()
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
f->process(dev, QRect(QPoint(0,0), qimage.size()), kfc);
......@@ -126,7 +126,7 @@ void KisFilterTest::testDifferentSrcAndDst()
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
f->process(src, dst, sel, QRect(QPoint(0,0), qimage.size()), kfc);
......@@ -167,7 +167,7 @@ void KisFilterTest::testOldDataApiAfterCopy()
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
/**
......@@ -215,7 +215,7 @@ void KisFilterTest::testBlurFilterApplicationRect()
KisFilterSP f = KisFilterRegistry::instance()->value("blur");
Q_ASSERT(f);
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
Q_ASSERT(kfc);
f->process(src1, dst1, 0, filterRect, kfc);
......
......@@ -167,7 +167,7 @@ void KisImageTest::testConvertImageColorSpace()
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
Q_ASSERT(filter);
KisFilterConfigurationSP configuration = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration = filter->defaultConfiguration();
Q_ASSERT(configuration);
KisLayerSP blur1 = new KisAdjustmentLayer(image, "blur1", configuration, 0);
......
......@@ -246,8 +246,8 @@ void KisLayerTest::testMasksChangeRect()
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
Q_ASSERT(filter);
KisFilterConfigurationSP configuration1 = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration2 = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration1 = filter->defaultConfiguration();
KisFilterConfigurationSP configuration2 = filter->defaultConfiguration();
filterMask1->setFilter(configuration1);
filterMask2->setFilter(configuration2);
......
......@@ -34,7 +34,7 @@ void KisRecordedFilterActionTest::testCreation()
{
const KoColorSpace * cs = KoColorSpaceRegistry::instance()->rgb8();
KisFilterSP f = KisFilterRegistry::instance()->value("invert");
KisFilterConfigurationSP kfc = f->defaultConfiguration(0);
KisFilterConfigurationSP kfc = f->defaultConfiguration();
KisImageSP image = new KisImage(0, 10, 10, cs, "merge test");
KisPaintLayerSP layer = new KisPaintLayer(image, "test", OPACITY_OPAQUE_U8);
......
......@@ -167,7 +167,7 @@ void KisSimpleUpdateQueueTest::testChecksum()
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
Q_ASSERT(filter);
KisFilterConfigurationSP configuration = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration = filter->defaultConfiguration();
KisTestableSimpleUpdateQueue queue;
......
......@@ -51,7 +51,7 @@ KisImageSP KisUpdateSchedulerTest::buildTestingImage()
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
Q_ASSERT(filter);
KisFilterConfigurationSP configuration = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration = filter->defaultConfiguration();
Q_ASSERT(configuration);
KisPaintLayerSP paintLayer1 = new KisPaintLayer(image, "paint1", OPACITY_OPAQUE_U8);
......
......@@ -329,7 +329,7 @@ void KisWalkersTest::testVisitingWithTopmostMask()
filterMask1->initSelection(groupLayer);
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
Q_ASSERT(filter);
KisFilterConfigurationSP configuration1 = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration1 = filter->defaultConfiguration();
filterMask1->setFilter(configuration1);
image->addNode(paintLayer1, image->rootLayer());
......@@ -843,8 +843,8 @@ void KisWalkersTest::testMasksVisiting()
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
Q_ASSERT(filter);
KisFilterConfigurationSP configuration1 = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration2 = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration1 = filter->defaultConfiguration();
KisFilterConfigurationSP configuration2 = filter->defaultConfiguration();
filterMask1->setFilter(configuration1);
filterMask2->setFilter(configuration2);
......@@ -916,8 +916,8 @@ void KisWalkersTest::testMasksVisitingNoFilthy()
KisFilterSP filter = KisFilterRegistry::instance()->value("blur");
Q_ASSERT(filter);
KisFilterConfigurationSP configuration1 = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration2 = filter->defaultConfiguration(0);
KisFilterConfigurationSP configuration1 = filter->defaultConfiguration();
KisFilterConfigurationSP configuration2 = filter->defaultConfiguration();
filterMask1->setFilter(configuration1);
filterMask2->setFilter(configuration2);
......@@ -993,8 +993,8 @@ void KisWalkersTest::testMasksOverlapping()
KisFilterSP invertFilter = KisFilterRegistry::instance()->value("invert");
Q_ASSERT(blurFilter);
Q_ASSERT(invertFilter);
KisFilterConfigurationSP blurConfiguration = blurFilter->defaultConfiguration(0);
KisFilterConfigurationSP invertConfiguration = invertFilter->defaultConfiguration(0);
KisFilterConfigurationSP blurConfiguration = blurFilter->defaultConfiguration();
KisFilterConfigurationSP invertConfiguration = invertFilter->defaultConfiguration();
filterMask1->setFilter(invertConfiguration);
filterMask2->setFilter(blurConfiguration);
......@@ -1151,14 +1151,14 @@ void KisWalkersTest::testRectsChecksum()
walker.collectRects(adjustmentLayer, dirtyRect);
QCOMPARE(walker.checksumValid(), true);
configuration = filter->defaultConfiguration(0);
configuration = filter->defaultConfiguration();
adjustmentLayer->setFilter(configuration);
QCOMPARE(walker.checksumValid(), false);
walker.recalculate(dirtyRect);
QCOMPARE(walker.checksumValid(), true);
configuration = filter->defaultConfiguration(0);
configuration = filter->defaultConfiguration();
configuration->setProperty("halfWidth", 20);
configuration->setProperty("halfHeight", 20);
adjustmentLayer->setFilter(configuration);
......@@ -1167,7 +1167,7 @@ void KisWalkersTest::testRectsChecksum()
walker.recalculate(dirtyRect);
QCOMPARE(walker.checksumValid(), true);
configuration = filter->defaultConfiguration(0);
configuration = filter->defaultConfiguration();
configuration->setProperty("halfWidth", 21);
configuration->setProperty("halfHeight", 21);
adjustmentLayer->setFilter(configuration);
......
......@@ -123,7 +123,7 @@ KisFilterConfigurationSP KisDlgAdjLayerProps::filterConfiguration() const
return config;
}
}
return m_currentFilter->defaultConfiguration(m_paintDevice);
return m_currentFilter->defaultConfiguration();
}
QString KisDlgAdjLayerProps::layerName() const
......
......@@ -54,6 +54,6 @@ KisFilterConfigurationSP KisBookmarkedFilterConfigurationsModel::configuration(c
{
KisFilterConfigurationSP config = dynamic_cast<KisFilterConfiguration*>(KisBookmarkedConfigurationsModel::configuration(index).data());
if (config) return config;
return d->filter->defaultConfiguration(d->thumb);
return d->filter->defaultConfiguration();
}
......@@ -240,7 +240,7 @@ void KisFilterManager::showFilterDialog(const QString &filterId)
d->filterDialog->setFilter(filter);
d->filterDialog->setVisible(true);
} else {
apply(KisFilterConfigurationSP(filter->defaultConfiguration(d->view->activeNode()->original())));
apply(KisFilterConfigurationSP(filter->defaultConfiguration()));
finish();
}
}
......
......@@ -208,7 +208,7 @@ void KisMaskManager::createFilterMask(KisNodeSP activeNode, KisPaintDeviceSP cop
// If we are supposed to not disturb the user, don't start asking them about things.
if(quiet) {
KisFilterConfigurationSP filter = KisFilterRegistry::instance()->values().first()->defaultConfiguration(originalDevice);
KisFilterConfigurationSP filter = KisFilterRegistry::instance()->values().first()->defaultConfiguration();
if (filter) {
mask->setFilter(filter);
mask->setName(mask->name());
......
......@@ -53,7 +53,7 @@ KisRecordedAction* KisRecordedFilterActionCreator::createAction() const
{
const KisFilter* filter = m_filterModel->indexToFilter(m_filterTree->currentIndex());
if(!filter) return 0;
return new KisRecordedFilterAction(filter->name(), KisNodeQueryPath::fromString(""), filter, filter->defaultConfiguration(0));
return new KisRecordedFilterAction(filter->name(), KisNodeQueryPath::fromString(""), filter, filter->defaultConfiguration());
}
......
......@@ -57,7 +57,7 @@ protected:
KisFilterSP filter = KisFilterRegistry::instance()->value(m_filterName);
Q_ASSERT(filter);
KisFilterConfigurationSP filterConfig = filter->defaultConfiguration(0);
KisFilterConfigurationSP filterConfig = filter->defaultConfiguration();
Q_ASSERT(filterConfig);
return new KisFilterStrokeStrategy(filter, KisFilterConfigurationSP(filterConfig), resources);
......
......@@ -34,12 +34,12 @@ void KisRecordedActionEditorTest::testFilterEditorCreation()
KisRecordedActionEditorFactoryRegistry* reg = KisRecordedActionEditorFactoryRegistry::instance();
const KisFilter* blurFilter = KisFilterRegistry::instance()->get("blur");
KisRecordedFilterAction* blurFilterAction = new KisRecordedFilterAction(
"hello", KisNodeQueryPath::fromString(""), blurFilter, blurFilter->defaultConfiguration(0));
"hello", KisNodeQueryPath::fromString(""), blurFilter, blurFilter->defaultConfiguration());
QVERIFY(reg->hasEditor(blurFilterAction));
QVERIFY(reg->createEditor(0, blurFilterAction));
const KisFilter* invertFilter = KisFilterRegistry::instance()->get("invert");
KisRecordedFilterAction* invertFilterAction = new KisRecordedFilterAction(
"hello", KisNodeQueryPath::fromString(""), invertFilter, invertFilter->defaultConfiguration(0));
"hello", KisNodeQueryPath::fromString(""), invertFilter, invertFilter->defaultConfiguration());
QVERIFY(reg->hasEditor(invertFilterAction));
QVERIFY(reg->createEditor(0, invertFilterAction));
}
......
......@@ -127,13 +127,13 @@ KisDocument* createCompleteDocument(bool shouldMaskToShapeLayer = false)
cloneLayer1->setY(100);
KisSelectionSP pixelSelection = createPixelSelection(paintLayer1->paintDevice());
KisFilterConfigurationSP kfc = KisFilterRegistry::instance()->get("pixelize")->defaultConfiguration(group2->projection());
KisFilterConfigurationSP kfc = KisFilterRegistry::instance()->get("pixelize")->defaultConfiguration();
Q_ASSERT(kfc);
KisAdjustmentLayerSP adjustmentLayer1 = new KisAdjustmentLayer(image, "adjustmentLayer1", kfc, pixelSelection);
kfc = 0; // kfc cannot be shared!
KisSelectionSP vectorSelection = createVectorSelection(paintLayer2->paintDevice(), image);
kfc = KisFilterRegistry::instance()->get("pixelize")->defaultConfiguration(group2->projection());
kfc = KisFilterRegistry::instance()->get("pixelize")->defaultConfiguration();
KisAdjustmentLayerSP adjustmentLayer2 = new KisAdjustmentLayer(image, "adjustmentLayer2", kfc, vectorSelection);
kfc = 0; // kfc cannot be shared!
......@@ -163,7 +163,7 @@ KisDocument* createCompleteDocument(bool shouldMaskToShapeLayer = false)
KisFilterMaskSP filterMask1 = new KisFilterMask();
filterMask1->setName("filterMask1");
kfc = KisFilterRegistry::instance()->get("pixelize")->defaultConfiguration(group2->projection());
kfc = KisFilterRegistry::instance()->get("pixelize")->defaultConfiguration();
filterMask1->setFilter(kfc);
kfc = 0; // kfc cannot be shared!
......@@ -173,7 +173,7 @@ KisDocument* createCompleteDocument(bool shouldMaskToShapeLayer = false)
KisFilterMaskSP filterMask2 = new KisFilterMask();
filterMask2->setName("filterMask2");
kfc = KisFilterRegistry::instance()->get("pixelize")->defaultConfiguration(group2->projection());
kfc = KisFilterRegistry::instance()->get("pixelize")->defaultConfiguration();
filterMask2->setFilter(kfc);
kfc = 0; // kfc cannot be shared!
......
......@@ -198,8 +198,7 @@ void KisFilterSelectorWidget::setFilter(KisFilterSP f)
widget->layout()->setContentsMargins(0,0,0,0);
d->currentFilterConfigurationWidget->setView(d->view);
d->currentFilterConfigurationWidget->blockSignals(true);
d->currentFilterConfigurationWidget->setConfiguration(
d->currentFilter->defaultConfiguration(d->paintDevice));
d->currentFilterConfigurationWidget->setConfiguration(d->currentFilter->defaultConfiguration());
d->currentFilterConfigurationWidget->blockSignals(false);
d->uiFilterSelector.scrollArea->setContentsMargins(0,0,0,0);
d->uiFilterSelector.scrollArea->setMinimumWidth(widget->sizeHint().width() + 18);
......@@ -288,7 +287,7 @@ KisFilterConfigurationSP KisFilterSelectorWidget::configuration()
return config;
}
} else if (d->currentFilter) {
return d->currentFilter->defaultConfiguration(d->paintDevice);
return d->currentFilter->defaultConfiguration();
}
return 0;
......
......@@ -125,7 +125,7 @@ KisFilterConfigurationSP KisWdgGenerator::configuration()
return config;
}
} else {
return d->currentGenerator->defaultConfiguration(0);
return d->currentGenerator->defaultConfiguration();
}
return 0;
}
......@@ -152,7 +152,7 @@ void KisWdgGenerator::slotGeneratorActivated(int row)
} else {
d->centralWidget = widget;
widget->setView(d->view);
widget->setConfiguration(d->currentGenerator->defaultConfiguration(d->dev));
widget->setConfiguration(d->currentGenerator->defaultConfiguration());
}
}
d->widgetLayout->addWidget(d->centralWidget, 0 , 0);
......
......@@ -49,7 +49,7 @@ KisConfigWidget * KisBlurFilter::createConfigurationWidget(QWidget* parent, cons
return new KisWdgBlur(parent);
}
KisFilterConfigurationSP KisBlurFilter::factoryConfiguration(const KisPaintDeviceSP) const
KisFilterConfigurationSP KisBlurFilter::factoryConfiguration() const
{
KisFilterConfigurationSP config = new KisFilterConfiguration(id().id(), 1);
config->setProperty("halfWidth", 5);
......
......@@ -38,7 +38,7 @@ public:
return KoID("blur", i18n("Blur"));
}
virtual KisFilterConfigurationSP factoryConfiguration(const KisPaintDeviceSP) const;
virtual KisFilterConfigurationSP factoryConfiguration() const;
public:
KisConfigWidget * createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev) const;
QRect neededRect(const QRect & rect, const KisFilterConfigurationSP _config, int lod) const;
......
......@@ -53,7 +53,7 @@ KisConfigWidget * KisGaussianBlurFilter::createConfigurationWidget(QWidget* pare
return new KisWdgGaussianBlur(parent);
}
KisFilterConfigurationSP KisGaussianBlurFilter::factoryConfiguration(const KisPaintDeviceSP) const
KisFilterConfigurationSP KisGaussianBlurFilter::factoryConfiguration() const
{
KisFilterConfigurationSP config = new KisFilterConfiguration(id().id(), 1);
config->setProperty("horizRadius", 5);
......
......@@ -40,7 +40,7 @@ public:
return KoID("gaussian blur", i18n("Gaussian Blur"));
}
virtual KisFilterConfigurationSP factoryConfiguration(const KisPaintDeviceSP) const;
virtual KisFilterConfigurationSP factoryConfiguration() const;
public:
KisConfigWidget * createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev) const;
QRect neededRect(const QRect & rect, const KisFilterConfigurationSP _config, int lod) const;
......
......@@ -65,7 +65,7 @@ QSize KisLensBlurFilter::getKernelHalfSize(const KisFilterConfigurationSP config
return QSize(w, h);
}
KisFilterConfigurationSP KisLensBlurFilter::factoryConfiguration(const KisPaintDeviceSP) const
KisFilterConfigurationSP KisLensBlurFilter::factoryConfiguration() const
{
KisFilterConfigurationSP config = new KisFilterConfiguration(id().id(), 1);
config->setProperty("irisShape", "Pentagon (5)");
......
......@@ -42,7 +42,7 @@ public:
return KoID("lens blur", i18n("Lens Blur"));
}
virtual KisFilterConfigurationSP factoryConfiguration(const KisPaintDeviceSP) const;
virtual KisFilterConfigurationSP factoryConfiguration() const;
static QSize getKernelHalfSize(const KisFilterConfigurationSP config, int lod);
......
......@@ -54,7 +54,7 @@ KisConfigWidget * KisMotionBlurFilter::createConfigurationWidget(QWidget* parent
return new KisWdgMotionBlur(parent);
}
KisFilterConfigurationSP KisMotionBlurFilter::factoryConfiguration(const KisPaintDeviceSP) const
KisFilterConfigurationSP KisMotionBlurFilter::factoryConfiguration() const
{
KisFilterConfigurationSP config = new KisFilterConfiguration(id().id(), 1);
config->setProperty("blurAngle", 0);
......
......@@ -42,7 +42,7 @@ public:
return KoID("motion blur", i18n("Motion Blur"));
}
virtual KisFilterConfigurationSP factoryConfiguration(const KisPaintDeviceSP) const;
virtual KisFilterConfigurationSP factoryConfiguration() const;
public:
KisConfigWidget * createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev) const;
QRect neededRect(const QRect & rect, const KisFilterConfigurationSP _config, int lod) const;
......
......@@ -49,7 +49,7 @@ KisConfigWidget * KisFilterColorToAlpha::createConfigurationWidget(QWidget* pare
return new KisWdgColorToAlpha(parent);
}
KisFilterConfigurationSP KisFilterColorToAlpha::factoryConfiguration(const KisPaintDeviceSP) const
KisFilterConfigurationSP KisFilterColorToAlpha::factoryConfiguration() const
{
KisFilterConfigurationSP config = new KisFilterConfiguration("colortoalpha", 1);
config->setProperty("targetcolor", QColor(255, 255, 255));
......
......@@ -43,7 +43,7 @@ public:
public:
virtual KisConfigWidget * createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev) const;
virtual KisFilterConfigurationSP factoryConfiguration(const KisPaintDeviceSP dev) const;
virtual KisFilterConfigurationSP factoryConfiguration() const;
};
#endif
......@@ -171,7 +171,7 @@ KisConfigWidget * KisBrightnessContrastFilter::createConfigurationWidget(QWidget
return new KisBrightnessContrastConfigWidget(parent, dev);
}
KisFilterConfigurationSP KisBrightnessContrastFilter::factoryConfiguration(const KisPaintDeviceSP