Skip to content

Commit

Permalink
variables renamed to be matched with the convention
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-fejcher committed Jul 8, 2024
1 parent 4868a9e commit be0ec5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/SBarcodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bool SBarcodeGenerator::generate(const QString &inputString)
.setEccLevel(m_eccLevel);

auto qrCodeMatrix = writer.encode(inputString.toStdString(), m_width, m_height);
_bitmap = ZXing::ToMatrix<uchar>(qrCodeMatrix, _backgroundColor.rgba(), _foregroundColor.rgba());
_bitmap = ZXing::ToMatrix<uchar>(qrCodeMatrix, m_backgroundColor.rgba(), m_foregroundColor.rgba());

m_filePath = QDir::tempPath() + "/" + m_fileName + "." + m_extension;

Expand All @@ -36,9 +36,9 @@ bool SBarcodeGenerator::generate(const QString &inputString)
for (int y = 0; y < m_height; ++y) {
for (int x = 0; x < m_width; ++x) {
if (qrCodeMatrix.get(x, y)) {
image.setPixelColor(x, y, _foregroundColor);
image.setPixelColor(x, y, m_foregroundColor);
} else {
image.setPixelColor(x, y, _backgroundColor);
image.setPixelColor(x, y, m_backgroundColor);
}
}
}
Expand Down Expand Up @@ -127,30 +127,30 @@ void SBarcodeGenerator::setFormat(const QString &formatName)

QColor SBarcodeGenerator::foregroundColor() const
{
return _foregroundColor;
return m_foregroundColor;
}

void SBarcodeGenerator::setForegroundColor(const QColor &foregroundColor)
{
if (_foregroundColor == foregroundColor) {
if (m_foregroundColor == foregroundColor) {
return;
}

_foregroundColor = foregroundColor;
m_foregroundColor = foregroundColor;
emit foregroundColorChanged();
}

QColor SBarcodeGenerator::backgroundColor() const
{
return _backgroundColor;
return m_backgroundColor;
}

void SBarcodeGenerator::setBackgroundColor(const QColor &backgroundColor)
{
if (_backgroundColor == backgroundColor) {
if (m_backgroundColor == backgroundColor) {
return;
}

_backgroundColor = backgroundColor;
m_backgroundColor = backgroundColor;
emit backgroundColorChanged();
}
4 changes: 2 additions & 2 deletions src/SBarcodeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ public slots:
SCodes::SBarcodeFormat m_format = SCodes::SBarcodeFormat::Code128;

ZXing::Matrix<uint8_t> _bitmap = ZXing::Matrix<uint8_t>();
QColor _foregroundColor = "white";
QColor _backgroundColor = "black";
QColor m_foregroundColor = "white";
QColor m_backgroundColor = "black";
};

#endif // SBARCODEGENERATOR_H

0 comments on commit be0ec5c

Please sign in to comment.