Commit 9a9c75a8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify

parent 61652e69
......@@ -89,7 +89,7 @@ static QString colorToString(QColor color, bool alpha)
return colorStr;
}
ChooseColorWidget::ChooseColorWidget(QString text, QString color, bool alphaEnabled, QWidget *parent) :
ChooseColorWidget::ChooseColorWidget(const QString &text, const QString &color, bool alphaEnabled, QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
......@@ -121,7 +121,7 @@ ChooseColorWidget::ChooseColorWidget(QString text, QString color, bool alphaEnab
connect(m_button, SIGNAL(changed(QColor)), this, SIGNAL(modified()));
}
QString ChooseColorWidget::getColor()
QString ChooseColorWidget::getColor() const
{
bool alphaChannel = false;
#if KDE_IS_VERSION(4,5,0)
......@@ -130,7 +130,7 @@ QString ChooseColorWidget::getColor()
return colorToString(m_button->color(), alphaChannel);
}
void ChooseColorWidget::setColor(QColor color)
void ChooseColorWidget::setColor(const QColor& color)
{
m_button->setColor(color);
}
......
......@@ -40,17 +40,17 @@ public:
* @param text (optional) What the color will be used for
* @param color (optional) initial color
* @param alphaEnabled (optional) Should transparent colors be enabled */
explicit ChooseColorWidget(QString text = QString(), QString color = "0xffffffff", bool alphaEnabled = false, QWidget* parent = 0);
explicit ChooseColorWidget(const QString &text = QString(), const QString &color = "0xffffffff", bool alphaEnabled = false, QWidget* parent = 0);
/** @brief Gets the choosen color. */
QString getColor();
QString getColor() const;
private:
KColorButton *m_button;
private slots:
/** @brief Updates the different color choosing options to have all selected @param color. */
void setColor(QColor color);
void setColor(const QColor &color);
signals:
/** @brief Emitted whenever a different color was choosen. */
......
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