Commit 79a3a146 authored by Boudewijn Rempt's avatar Boudewijn Rempt

const -- the sweetest keyword in the language.

svn path=/trunk/koffice/; revision=875833
parent c67c7e55
......@@ -74,9 +74,6 @@ Functionality that _should_ be in KOffice
BR * When changing the image size, the canvas doesn't realize that (change document
size on canvas controller when image size changes)
* Fix QPainter::restore: Unbalanced save/restore messages
BR * Krita freezes when trying to set the tablet paintop settings for the brush paintop.
(And there's something wrong with the adding of this widget to the toolbar -- moving
this widget to krita/ui and making it more flexible, plus make use of KisPopupButton)
* Image
......
......@@ -53,7 +53,7 @@ public:
/**
* @param config the configuration for this configuration widget.
*/
virtual void setConfiguration(KisPropertiesConfiguration * config) = 0;
virtual void setConfiguration(const KisPropertiesConfiguration * config) = 0;
/**
* @return the configuration
......
......@@ -31,7 +31,7 @@ public:
: KisConfigWidget(0) {
}
void setConfiguration( KisPropertiesConfiguration *) {
void setConfiguration( const KisPropertiesConfiguration *) {
}
KisPropertiesConfiguration * configuration() const {
......
......@@ -62,7 +62,7 @@ KisPropertiesConfiguration* KisWdgBlur::configuration() const
return config;
}
void KisWdgBlur::setConfiguration(KisPropertiesConfiguration* config)
void KisWdgBlur::setConfiguration(const KisPropertiesConfiguration* config)
{
QVariant value;
if (config->getProperty("shape", value)) {
......
......@@ -34,7 +34,7 @@ public:
inline const Ui_WdgBlur* widget() const {
return m_widget;
}
virtual void setConfiguration(KisPropertiesConfiguration*);
virtual void setConfiguration(const KisPropertiesConfiguration*);
virtual KisPropertiesConfiguration* configuration() const;
private slots:
......
......@@ -406,7 +406,7 @@ KisBumpmapConfigWidget::KisBumpmapConfigWidget(const KisPaintDeviceSP dev, const
}
void KisBumpmapConfigWidget::setConfiguration(KisPropertiesConfiguration * cfg)
void KisBumpmapConfigWidget::setConfiguration(const KisPropertiesConfiguration * cfg)
{
if (!cfg) return;
......
......@@ -109,7 +109,7 @@ public:
KisBumpmapConfigWidget(const KisPaintDeviceSP dev, const KisImageSP image, QWidget * parent, Qt::WFlags f = 0);
virtual ~KisBumpmapConfigWidget() {}
void setConfiguration(KisPropertiesConfiguration* config);
void setConfiguration(const KisPropertiesConfiguration* config);
KisPropertiesConfiguration* configuration() const;
BumpmapWidget * m_page;
......
......@@ -75,9 +75,9 @@ KisPropertiesConfiguration* KisCImgconfigWidget::configuration() const
}
void KisCImgconfigWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisCImgconfigWidget::setConfiguration(const KisPropertiesConfiguration * config)
{
KisCImgFilterConfiguration * cfg = dynamic_cast<KisCImgFilterConfiguration*>(config);
const KisCImgFilterConfiguration * cfg = dynamic_cast<const KisCImgFilterConfiguration*>(config);
if (!cfg) return;
m_page->numDetail->setValue(cfg->power1);
......
......@@ -49,7 +49,7 @@ public:
public:
KisPropertiesConfiguration* configuration() const;
void setConfiguration(KisPropertiesConfiguration* config);
void setConfiguration(const KisPropertiesConfiguration* config);
private:
WdgCImg * m_page;
......
......@@ -41,7 +41,7 @@ KisWdgColorToAlpha::KisWdgColorToAlpha(QWidget * parent) : KisConfigWidget(paren
connect(m_widget->intThreshold, SIGNAL(valueChanged(int)), SIGNAL(sigConfigChanged()));
}
void KisWdgColorToAlpha::setConfiguration(KisPropertiesConfiguration* config)
void KisWdgColorToAlpha::setConfiguration(const KisPropertiesConfiguration* config)
{
QVariant value;
if (config->getProperty("targetcolor", value)) {
......
......@@ -34,7 +34,7 @@ public:
inline const Ui_WdgColorToAlphaBase* widget() const {
return m_widget;
}
virtual void setConfiguration(KisPropertiesConfiguration*);
virtual void setConfiguration(const KisPropertiesConfiguration*);
virtual KisPropertiesConfiguration* configuration() const;
private:
Ui_WdgColorToAlphaBase* m_widget;
......
......@@ -356,9 +356,9 @@ KisBrightnessContrastFilterConfiguration * KisBrightnessContrastConfigWidget::co
return cfg;
}
void KisBrightnessContrastConfigWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisBrightnessContrastConfigWidget::setConfiguration(const KisPropertiesConfiguration * config)
{
KisBrightnessContrastFilterConfiguration * cfg = dynamic_cast<KisBrightnessContrastFilterConfiguration *>(config);
const KisBrightnessContrastFilterConfiguration * cfg = dynamic_cast<const KisBrightnessContrastFilterConfiguration *>(config);
Q_ASSERT(cfg);
m_page->kCurve->setCurve(cfg->curve);
}
......
......@@ -102,7 +102,7 @@ public:
virtual ~KisBrightnessContrastConfigWidget() {}
virtual KisBrightnessContrastFilterConfiguration * configuration() const;
virtual void setConfiguration(KisPropertiesConfiguration* config);
virtual void setConfiguration( const KisPropertiesConfiguration* config);
WdgBrightnessContrast * m_page;
};
......
......@@ -122,7 +122,7 @@ KisPropertiesConfiguration * KisHSVConfigWidget::configuration() const
return c;
}
void KisHSVConfigWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisHSVConfigWidget::setConfiguration( const KisPropertiesConfiguration * config)
{
m_page->hue->setValue(config->getInt("h", 0));
m_page->saturation->setValue(config->getInt("s", 0));
......
......@@ -68,7 +68,7 @@ public:
virtual ~KisHSVConfigWidget();
virtual KisPropertiesConfiguration * configuration() const;
virtual void setConfiguration(KisPropertiesConfiguration* config);
virtual void setConfiguration(const KisPropertiesConfiguration* config);
Ui_WdgHSVAdjustment * m_page;
};
......
......@@ -420,9 +420,9 @@ KisPropertiesConfiguration * KisPerChannelConfigWidget::configuration() const
return cfg;
}
void KisPerChannelConfigWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisPerChannelConfigWidget::setConfiguration(const KisPropertiesConfiguration * config)
{
KisPerChannelFilterConfiguration * cfg = dynamic_cast<KisPerChannelFilterConfiguration *>(config);
const KisPerChannelFilterConfiguration * cfg = dynamic_cast<const KisPerChannelFilterConfiguration *>(config);
if (!cfg)
return;
......
......@@ -100,7 +100,7 @@ public:
KisPerChannelConfigWidget(QWidget * parent, KisPaintDeviceSP dev, Qt::WFlags f = 0);
virtual ~KisPerChannelConfigWidget() {}
virtual void setConfiguration(KisPropertiesConfiguration* config);
virtual void setConfiguration(const KisPropertiesConfiguration* config);
virtual KisPropertiesConfiguration * configuration() const;
private slots:
......
......@@ -39,7 +39,7 @@ KisWdgFastColorTransfer::~KisWdgFastColorTransfer()
{
}
void KisWdgFastColorTransfer::setConfiguration(KisPropertiesConfiguration* config)
void KisWdgFastColorTransfer::setConfiguration( const KisPropertiesConfiguration* config)
{
QVariant value;
if (config->getProperty("filename", value)) {
......
......@@ -34,7 +34,7 @@ class KisWdgFastColorTransfer : public KisConfigWidget
public:
KisWdgFastColorTransfer(QWidget * parent);
~KisWdgFastColorTransfer();
virtual void setConfiguration(KisPropertiesConfiguration*);
virtual void setConfiguration(const KisPropertiesConfiguration*);
inline const Ui_WdgFastColorTransfer* widget() const {
return m_widget;
}
......
......@@ -45,7 +45,7 @@ KisWdgLensCorrection::~KisWdgLensCorrection()
{
}
void KisWdgLensCorrection::setConfiguration(KisPropertiesConfiguration* config)
void KisWdgLensCorrection::setConfiguration(const KisPropertiesConfiguration* config)
{
QVariant value;
if (config->getProperty("xcenter", value)) {
......
......@@ -36,7 +36,7 @@ public:
inline const Ui_WdgLensCorrectionOptions* widget() const {
return m_widget;
}
virtual void setConfiguration(KisPropertiesConfiguration*);
virtual void setConfiguration(const KisPropertiesConfiguration*);
virtual KisPropertiesConfiguration* configuration() const;
private:
Ui_WdgLensCorrectionOptions* m_widget;
......
......@@ -273,7 +273,7 @@ KisPropertiesConfiguration * KisLevelConfigWidget::configuration() const
return config;
}
void KisLevelConfigWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisLevelConfigWidget::setConfiguration(const KisPropertiesConfiguration * config)
{
QVariant value;
if (config->getProperty("blackvalue", value)) {
......
......@@ -92,7 +92,7 @@ public:
virtual ~KisLevelConfigWidget();
virtual KisPropertiesConfiguration* configuration() const;
void setConfiguration(KisPropertiesConfiguration* config);
void setConfiguration(const KisPropertiesConfiguration* config);
Ui::WdgLevel m_page;
protected slots:
......
......@@ -47,7 +47,7 @@ KisWdgNoise::~KisWdgNoise()
{
}
void KisWdgNoise::setConfiguration(KisPropertiesConfiguration* config)
void KisWdgNoise::setConfiguration(const KisPropertiesConfiguration* config)
{
QVariant value;
if (config->getProperty("level", value)) {
......
......@@ -36,7 +36,7 @@ public:
inline const Ui_WdgNoiseOptions* widget() const {
return m_widget;
}
virtual void setConfiguration(KisPropertiesConfiguration*);
virtual void setConfiguration(const KisPropertiesConfiguration*);
virtual KisPropertiesConfiguration* configuration() const;
private:
Ui_WdgNoiseOptions* m_widget;
......
......@@ -47,7 +47,7 @@ KisWdgRandomPick::~KisWdgRandomPick()
{
}
void KisWdgRandomPick::setConfiguration(KisPropertiesConfiguration* config)
void KisWdgRandomPick::setConfiguration(const KisPropertiesConfiguration* config)
{
QVariant value;
if (config->getProperty("level", value)) {
......
......@@ -36,7 +36,7 @@ public:
inline const Ui_WdgRandomPickOptions* widget() const {
return m_widget;
}
virtual void setConfiguration(KisPropertiesConfiguration*);
virtual void setConfiguration(const KisPropertiesConfiguration*);
virtual KisPropertiesConfiguration* configuration() const;
private:
Ui_WdgRandomPickOptions* m_widget;
......
......@@ -41,7 +41,7 @@ KisWdgUnsharp::KisWdgUnsharp(QWidget * parent) : KisConfigWidget(parent)
connect(widget()->intThreshold, SIGNAL(valueChanged(int)), SIGNAL(sigConfigChanged()));
}
void KisWdgUnsharp::setConfiguration(KisPropertiesConfiguration* config)
void KisWdgUnsharp::setConfiguration(const KisPropertiesConfiguration* config)
{
QVariant value;
widget()->intHalfSize->setValue((config->getProperty("halfSize", value)) ? value.toUInt() : 4);
......
......@@ -34,7 +34,7 @@ public:
inline const Ui_WdgUnsharp* widget() const {
return m_widget;
}
virtual void setConfiguration(KisPropertiesConfiguration*);
virtual void setConfiguration( const KisPropertiesConfiguration*);
virtual KisPropertiesConfiguration* configuration() const;
private:
Ui_WdgUnsharp* m_widget;
......
......@@ -46,7 +46,7 @@ KisWdgWave::~KisWdgWave()
{
}
void KisWdgWave::setConfiguration(KisPropertiesConfiguration* config)
void KisWdgWave::setConfiguration( const KisPropertiesConfiguration* config)
{
QVariant value;
if (config->getProperty("horizontalwavelength", value)) {
......
......@@ -36,7 +36,7 @@ public:
inline const Ui_WdgWaveOptions* widget() const {
return m_widget;
}
virtual void setConfiguration(KisPropertiesConfiguration*);
virtual void setConfiguration( const KisPropertiesConfiguration*);
virtual KisPropertiesConfiguration* configuration() const;
private:
Ui_WdgWaveOptions* m_widget;
......
......@@ -39,7 +39,7 @@ KisWdgColor::~KisWdgColor()
{
}
void KisWdgColor::setConfiguration(KisPropertiesConfiguration* config)
void KisWdgColor::setConfiguration( const KisPropertiesConfiguration* config)
{
QVariant value;
if (config->getProperty("color", value)) {
......
......@@ -35,7 +35,7 @@ public:
inline const Ui_WdgColorOptions* widget() const {
return m_widget;
}
virtual void setConfiguration(KisPropertiesConfiguration*);
virtual void setConfiguration( const KisPropertiesConfiguration*);
virtual KisPropertiesConfiguration* configuration() const;
private:
Ui_WdgColorOptions* m_widget;
......
......@@ -58,7 +58,7 @@ public:
virtual ~KisCPaintOpWidget(){}
virtual void setConfiguration(KisPropertiesConfiguration * config)
virtual void setConfiguration( const KisPropertiesConfiguration * config)
{
}
......
......@@ -51,7 +51,7 @@ KisAirbrushOpSettingsWidget::~KisAirbrushOpSettingsWidget()
delete m_brushOption;
}
void KisAirbrushOpSettingsWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisAirbrushOpSettingsWidget::setConfiguration( const KisPropertiesConfiguration * config)
{
m_brushOption->readOptionSetting(config);
}
......
......@@ -41,7 +41,7 @@ public:
~KisAirbrushOpSettingsWidget();
void setConfiguration(KisPropertiesConfiguration * config);
void setConfiguration( const KisPropertiesConfiguration * config);
KisPropertiesConfiguration* configuration() const;
......
......@@ -59,7 +59,7 @@ public:
{
}
virtual void setConfiguration(KisPropertiesConfiguration * config)
virtual void setConfiguration( const KisPropertiesConfiguration * config)
{
}
......
......@@ -58,7 +58,7 @@ KisBrushOpSettingsWidget::~KisBrushOpSettingsWidget()
delete m_paintActionTypeOption;
}
void KisBrushOpSettingsWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisBrushOpSettingsWidget::setConfiguration( const KisPropertiesConfiguration * config)
{
m_brushOption->readOptionSetting(config);
m_sizeOption->readOptionSetting(config);
......
......@@ -41,7 +41,7 @@ public:
virtual ~KisBrushOpSettingsWidget();
void setConfiguration(KisPropertiesConfiguration * config);
void setConfiguration( const KisPropertiesConfiguration * config);
KisPropertiesConfiguration* configuration() const;
......
......@@ -58,7 +58,7 @@ KisDuplicateOpSettingsWidget::~KisDuplicateOpSettingsWidget()
delete m_paintActionTypeOption;
}
void KisDuplicateOpSettingsWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisDuplicateOpSettingsWidget::setConfiguration( const KisPropertiesConfiguration * config)
{
m_brushOption->readOptionSetting(config);
m_sizeOption->readOptionSetting(config);
......
......@@ -41,7 +41,7 @@ public:
~KisDuplicateOpSettingsWidget();
void setConfiguration(KisPropertiesConfiguration * config);
void setConfiguration( const KisPropertiesConfiguration * config);
KisPropertiesConfiguration* configuration() const;
......
......@@ -58,7 +58,7 @@ KisEraseOpSettingsWidget::~KisEraseOpSettingsWidget()
delete m_paintActionTypeOption;
}
void KisEraseOpSettingsWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisEraseOpSettingsWidget::setConfiguration( const KisPropertiesConfiguration * config)
{
m_brushOption->readOptionSetting(config);
m_sizeOption->readOptionSetting(config);
......
......@@ -41,7 +41,7 @@ public:
~KisEraseOpSettingsWidget();
void setConfiguration(KisPropertiesConfiguration * config);
void setConfiguration( const KisPropertiesConfiguration * config);
KisPropertiesConfiguration* configuration() const;
......
......@@ -58,7 +58,7 @@ KisPenOpSettingsWidget::~KisPenOpSettingsWidget()
delete m_paintActionTypeOption;
}
void KisPenOpSettingsWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisPenOpSettingsWidget::setConfiguration( const KisPropertiesConfiguration * config)
{
m_brushOption->readOptionSetting(config);
m_sizeOption->readOptionSetting(config);
......
......@@ -41,7 +41,7 @@ public:
~KisPenOpSettingsWidget();
void setConfiguration(KisPropertiesConfiguration * config);
void setConfiguration( const KisPropertiesConfiguration * config);
KisPropertiesConfiguration* configuration() const;
......
......@@ -58,7 +58,7 @@ KisSmudgeOpSettingsWidget::~KisSmudgeOpSettingsWidget()
delete m_paintActionTypeOption;
}
void KisSmudgeOpSettingsWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisSmudgeOpSettingsWidget::setConfiguration( const KisPropertiesConfiguration * config)
{
m_brushOption->readOptionSetting(config);
m_sizeOption->readOptionSetting(config);
......
......@@ -41,7 +41,7 @@ public:
~KisSmudgeOpSettingsWidget();
void setConfiguration(KisPropertiesConfiguration * config);
void setConfiguration( const KisPropertiesConfiguration * config);
KisPropertiesConfiguration* configuration() const;
......
......@@ -40,7 +40,7 @@ public:
virtual ~KisDeformOpWidget(){}
virtual void setConfiguration(KisPropertiesConfiguration * config)
virtual void setConfiguration( const KisPropertiesConfiguration * config)
{
}
......
......@@ -67,7 +67,7 @@ public:
virtual ~KisDynamicOpWidget(){}
virtual void setConfiguration(KisPropertiesConfiguration * config)
virtual void setConfiguration( const KisPropertiesConfiguration * config)
{
}
......
......@@ -55,7 +55,7 @@ public:
virtual ~KisFilterOpWidget(){}
virtual void setConfiguration(KisPropertiesConfiguration * config)
virtual void setConfiguration( const KisPropertiesConfiguration * config)
{
}
......@@ -171,7 +171,7 @@ KisPaintOpSettingsSP KisFilterOpSettings::clone() const
s->setCurrentFilter(KoID(m_currentFilter->id()));
s->m_uiOptions->checkBoxIgnoreAlpha->setChecked(ignoreAlpha());
if (s->m_currentFilterConfigWidget && m_currentFilterConfigWidget) {
s->m_currentFilterConfigWidget->setConfiguration(m_currentFilterConfigWidget->configuration());
s->m_currentFilterConfigWidget->setConfiguration( constm_currentFilterConfigWidget->configuration());
}
return s;
}
......@@ -188,7 +188,7 @@ void KisFilterOpSettings::fromXML(const QDomElement& elt)
KisFilterConfiguration * kfc = m_currentFilter->defaultConfiguration(m_paintDevice);
if (kfc && m_currentFilterConfigWidget) {
kfc->fromXML(e);
m_currentFilterConfigWidget->setConfiguration(kfc);
m_currentFilterConfigWidget->setConfiguration( constkfc);
}
}
m_uiOptions->checkBoxIgnoreAlpha->setChecked(elt.attribute("IgnoreAlpha").toInt(0));
......
......@@ -44,7 +44,7 @@ KisSumiPaintOpSettingsWidget::~ KisSumiPaintOpSettingsWidget()
{
}
void KisSumiPaintOpSettingsWidget::setConfiguration(KisPropertiesConfiguration * config)
void KisSumiPaintOpSettingsWidget::setConfiguration( const KisPropertiesConfiguration * config)
{
// XXX: Use a regular curve option here!
QList<float> c;
......
......@@ -32,7 +32,7 @@ public:
virtual ~KisSumiPaintOpSettingsWidget();
void setConfiguration(KisPropertiesConfiguration * config);
void setConfiguration( const KisPropertiesConfiguration * config);
KisPropertiesConfiguration* configuration() const;
......
......@@ -37,7 +37,7 @@ public:
/**
* @param config the configuration widget for this tonemapping operator.
*/
virtual void setConfiguration(KisPropertiesConfiguration* config) = 0;
virtual void setConfiguration( const KisPropertiesConfiguration* config) = 0;
/**
* @return the tonemapping operator configuration
......
......@@ -38,7 +38,7 @@ public:
KisAshikhmin02OperatorConfigurationWidget(QWidget* wdg) : KisToneMappingOperatorConfigurationWidget(wdg) {
widget.setupUi(this);
}
virtual void setConfiguration(KisPropertiesConfiguration* config) {
virtual void setConfiguration( const KisPropertiesConfiguration* config) {
widget.simple->setChecked(config->getBool("Simple", false));
widget.localContrast->setValue(config->getDouble("LocalContrastThreshold", 0.5));
if (config->getInt("Equation", 2) == 2) {
......
......@@ -40,7 +40,7 @@ public:
KisIcamOperatorConfigurationWidget(QWidget* wdg) : KisToneMappingOperatorConfigurationWidget(wdg) {
widget.setupUi(this);
}
virtual void setConfiguration(KisPropertiesConfiguration* config) {
virtual void setConfiguration( const KisPropertiesConfiguration* config) {
widget.independence->setChecked(config->getBool("Independence", false));
widget.variance->setValue(config->getDouble("Variance", -0.10));
widget.variance2->setValue(config->getDouble("Variance2", -0.30));
......
......@@ -40,7 +40,7 @@ public:
KisReinhard02OperatorConfigurationWidget(QWidget* wdg) : KisToneMappingOperatorConfigurationWidget(wdg) {
widget.setupUi(this);
}
virtual void setConfiguration(KisPropertiesConfiguration* config) {
virtual void setConfiguration( const KisPropertiesConfiguration* config) {
widget.scales->setChecked(config->getBool("Scales", false));
widget.key->setValue(config->getDouble("Key", 0.18));
widget.phi->setValue(config->getDouble("Phi", 1.0));
......
......@@ -39,7 +39,7 @@ public:
KisReinhard05OperatorConfigurationWidget(QWidget* wdg) : KisToneMappingOperatorConfigurationWidget(wdg) {
widget.setupUi(this);
}
virtual void setConfiguration(KisPropertiesConfiguration* config) {
virtual void setConfiguration( const KisPropertiesConfiguration* config) {
widget.brightness->setValue(config->getDouble("Brightness", 0.0));
widget.chromatic->setValue(config->getDouble("Chromatic", 0.0));
widget.light->setValue(config->getDouble("Light", 1.0));
......
......@@ -40,7 +40,7 @@ public:
KisTrilateralOperatorConfigurationWidget(QWidget* wdg) : KisToneMappingOperatorConfigurationWidget(wdg) {
widget.setupUi(this);
}
virtual void setConfiguration(KisPropertiesConfiguration* config) {
virtual void setConfiguration( const KisPropertiesConfiguration* config) {