Commit 004041fa authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen 🌈
Browse files

sketch: A bit of more code to go with the previous commit re slow widgets

parent a046f58c
......@@ -213,13 +213,14 @@ void FiltersCategoryModel::filterConfigurationChanged(int index, FiltersModel* m
return;
}
KisSafeFilterConfigurationSP config;
if(model->filter(index)->showConfigurationWidget()) {
KisConfigWidget* wdg = model->filter(index)->createConfigurationWidget(0, d->view->activeNode()->original());
KisFilter* filter = model->filter(index);
if(filter->showConfigurationWidget() && filter->id() != QLatin1String("colortransfer")) {
KisConfigWidget* wdg = filter->createConfigurationWidget(0, d->view->activeNode()->original());
wdg->deleteLater();
config = KisSafeFilterConfigurationSP(KisFilterRegistry::instance()->cloneConfiguration(static_cast<KisFilterConfiguration*>(wdg->configuration())));
}
else {
config = KisSafeFilterConfigurationSP(KisFilterRegistry::instance()->cloneConfiguration(model->filter(index)->defaultConfiguration(d->view->activeNode()->original())));
config = KisSafeFilterConfigurationSP(KisFilterRegistry::instance()->cloneConfiguration(filter->defaultConfiguration(d->view->activeNode()->original())));
}
QObject* configuration = d->categories[d->currentCategory]->configuration(index);
foreach(const QByteArray& propName, configuration->dynamicPropertyNames()) {
......
......@@ -159,7 +159,7 @@ QObject* FiltersModel::configuration(int index)
PropertyContainer* config = new PropertyContainer(d->filters[index]->id(), this);
if (!d->configurations[index]) {
// if we have a config widget to show, reinitialise the configuration, just in case
if(d->filters[index]->showConfigurationWidget()) {
if(d->filters[index]->showConfigurationWidget() && d->filters[index]->id() != QLatin1String("colortransfer")) {
KisConfigWidget* wdg = d->filters[index]->createConfigurationWidget(0, d->view->activeNode()->original());
wdg->deleteLater();
d->configurations[index] = KisSafeFilterConfigurationSP(static_cast<KisFilterConfiguration*>(wdg->configuration()));
......
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