Commit 9044a28b authored by Ivan Yossi's avatar Ivan Yossi 👌

Minor Style fixes

parent e75cefac
......@@ -466,7 +466,7 @@ bool KisImportExportManager::askUserAboutExportConfiguration(
wdg = filter->createConfigurationWidget(0, from, to);
KisMainWindow *kisMain = KisPart::instance()->currentMainwindow();
if(wdg && kisMain) {
if (wdg && kisMain) {
KisViewManager *manager = kisMain->viewManager();
wdg->setView(manager);
}
......
......@@ -27,7 +27,7 @@
KisWdgOptionsBrush::KisWdgOptionsBrush(QWidget *parent)
: KisConfigWidget(parent)
, currentDimensions(0)
, m_currentDimensions(0)
, m_layersCount(0)
, m_view(0)
{
......@@ -47,12 +47,10 @@ KisWdgOptionsBrush::KisWdgOptionsBrush(QWidget *parent)
slotActivateDimensionRanks();
}
void KisWdgOptionsBrush::setConfiguration(const KisPropertiesConfigurationSP cfg)
{
spacingWidget->setSpacing(false, cfg->getDouble("spacing"));
if(nameLineEdit->text().isEmpty()){
if (nameLineEdit->text().isEmpty()) {
nameLineEdit->setText(cfg->getString("name"));
}
colorAsMask->setChecked(cfg->getBool("mask"));
......@@ -62,7 +60,7 @@ void KisWdgOptionsBrush::setConfiguration(const KisPropertiesConfigurationSP cfg
QLayoutItem *item;
BrushPipeSelectionModeHelper *bp;
for (int i = 0; i < dimensionSpin->maximum(); ++i) {
if((item = dimRankLayout->itemAt(i)) != 0) {
if ((item = dimRankLayout->itemAt(i)) != 0) {
bp = dynamic_cast<BrushPipeSelectionModeHelper*>(item->widget());
bp->cmbSelectionMode.setCurrentIndex(cfg->getInt("selectionMode" + QString::number(i)));
bp->rankSpinBox.setValue(cfg->getInt("rank" + QString::number(i)));
......@@ -82,7 +80,7 @@ KisPropertiesConfigurationSP KisWdgOptionsBrush::configuration() const
QLayoutItem *item;
BrushPipeSelectionModeHelper *bp;
for (int i = 0; i < dimensionSpin->maximum(); ++i) {
if((item = dimRankLayout->itemAt(i)) != 0) {
if ((item = dimRankLayout->itemAt(i)) != 0) {
bp = dynamic_cast<BrushPipeSelectionModeHelper*>(item->widget());
cfg->setProperty("selectionMode" + QString::number(i), bp->cmbSelectionMode.currentIndex());
cfg->setProperty("rank" + QString::number(i), bp->rankSpinBox.value());
......@@ -92,7 +90,6 @@ KisPropertiesConfigurationSP KisWdgOptionsBrush::configuration() const
return cfg;
}
void KisWdgOptionsBrush::setView(KisViewManager *view)
{
if (view) {
......@@ -105,7 +102,8 @@ void KisWdgOptionsBrush::setView(KisViewManager *view)
}
}
void KisWdgOptionsBrush::slotEnableSelectionMethod(int value) {
void KisWdgOptionsBrush::slotEnableSelectionMethod(int value)
{
if (value == 0) {
animStyleGroup->setEnabled(false);
} else {
......@@ -118,9 +116,9 @@ void KisWdgOptionsBrush::slotActivateDimensionRanks()
QLayoutItem *item;
BrushPipeSelectionModeHelper *bp;
int dim = this->dimensionSpin->value();
if(dim >= currentDimensions) {
for (int i = currentDimensions; i < dim; ++i) {
if((item = dimRankLayout->itemAt(i)) != 0) {
if (dim >= m_currentDimensions) {
for (int i = m_currentDimensions; i < dim; ++i) {
if ((item = dimRankLayout->itemAt(i)) != 0) {
bp = dynamic_cast<BrushPipeSelectionModeHelper*>(item->widget());
bp->setEnabled(true);
bp->show();
......@@ -128,19 +126,19 @@ void KisWdgOptionsBrush::slotActivateDimensionRanks()
}
}
else {
for (int i = currentDimensions -1; i >= dim; --i) {
if((item = dimRankLayout->itemAt(i)) != 0) {
for (int i = m_currentDimensions -1; i >= dim; --i) {
if ((item = dimRankLayout->itemAt(i)) != 0) {
bp = dynamic_cast<BrushPipeSelectionModeHelper*>(item->widget());
bp->setEnabled(false);
bp->hide();
}
}
}
currentDimensions = dim;
m_currentDimensions = dim;
}
void KisWdgOptionsBrush::slotRecalculateRanks(int rankDimension) {
// currentDimensions;
void KisWdgOptionsBrush::slotRecalculateRanks(int rankDimension)
{
int rankSum = 0;
int maxDim = this->dimensionSpin->maximum();
......@@ -148,7 +146,7 @@ void KisWdgOptionsBrush::slotRecalculateRanks(int rankDimension) {
QLayoutItem *item;
for (int i = 0; i < maxDim; ++i) {
if((item = dimRankLayout->itemAt(i)) != 0) {
if ((item = dimRankLayout->itemAt(i)) != 0) {
bp.push_back(dynamic_cast<BrushPipeSelectionModeHelper*>(item->widget()));
rankSum += bp.at(i)->rankSpinBox.value();
}
......@@ -161,7 +159,7 @@ void KisWdgOptionsBrush::slotRecalculateRanks(int rankDimension) {
while (rankSum > m_layersCount && bpIterator.hasNext()) {
currentBrushHelper = bpIterator.next();
if(currentBrushHelper != callerBrushHelper) {
if (currentBrushHelper != callerBrushHelper) {
int currentValue = currentBrushHelper->rankSpinBox.value();
currentBrushHelper->rankSpinBox.setValue(currentValue -1);
rankSum -= currentValue;
......
......@@ -114,7 +114,7 @@ public Q_SLOTS:
void slotRecalculateRanks(int rankDimension = 0);
private:
int currentDimensions;
int m_currentDimensions;
int m_layersCount;
KisViewManager *m_view;
};
......
......@@ -170,7 +170,7 @@ KisImportExportErrorCode KisBrushExport::convert(KisDocument *document, QIODevic
pipeBrush->setParasite(parasite);
pipeBrush->setDevices(devices, rc.width(), rc.height());
if(exportOptions.mask) {
if (exportOptions.mask) {
QVector<KisGbrBrush*> brushes = pipeBrush->brushes();
Q_FOREACH(KisGbrBrush* brush, brushes) {
brush->setHasColor(false);
......@@ -178,7 +178,7 @@ KisImportExportErrorCode KisBrushExport::convert(KisDocument *document, QIODevic
}
}
else {
if (exportOptions.mask){
if (exportOptions.mask) {
QImage image = document->savingImage()->projection()->convertToQImage(0, 0, 0, rc.width(), rc.height(), KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags());
brush->setImage(image);
brush->setBrushTipImage(image);
......@@ -188,7 +188,7 @@ KisImportExportErrorCode KisBrushExport::convert(KisDocument *document, QIODevic
}
brush->setName(exportOptions.name);
// brushes are created after devices are loaded, mask mode must b after that
// brushes are created after devices are loaded, call mask mode after that
brush->setUseColorAsMask(exportOptions.mask);
brush->setWidth(rc.width());
brush->setHeight(rc.height());
......
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