Commit f1b0412a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

use const'ref

parent 6c53c85e
......@@ -179,10 +179,10 @@ QString UnicodeDialog::unicodeInfo(const QString &unicode)
return infoText;
}
QString UnicodeDialog::validateText(QString text)
QString UnicodeDialog::validateText(const QString &text)
{
QRegExp regex("([0-9]|[a-f])", Qt::CaseInsensitive, QRegExp::RegExp2);
QString newText = "";
QString newText;
int pos = 0;
switch (inputMethod) {
......@@ -204,8 +204,8 @@ QString UnicodeDialog::validateText(QString text)
void UnicodeDialog::updateOverviewChars(uint unicode)
{
QString left = "";
QString right = "";
QString left;
QString right;
uint i;
for (i = 1; i <= 4; i++) {
......@@ -233,7 +233,7 @@ void UnicodeDialog::clearOverviewChars()
rightChars->setText("");
}
QString UnicodeDialog::nextUnicode(QString text, Direction direction)
QString UnicodeDialog::nextUnicode(const QString &text, Direction direction)
{
uint value = 0;
QString newText = "";
......
......@@ -44,7 +44,7 @@ private:
InputMethod inputMethod;
/** \brief Validates text and removes all invalid characters (non-hex e.g.) */
QString validateText(QString text);
QString validateText(const QString &text);
/** \brief Removes all leading zeros */
QString trimmedUnicodeNumber(QString text);
/** \brief Checks whether the given string is a control character */
......@@ -53,7 +53,7 @@ private:
bool controlCharacter(uint value);
/** \brief Returns the next available unicode. */
QString nextUnicode(QString text, Direction direction);
QString nextUnicode(const QString &text, Direction direction);
/** \brief Paints previous and next characters around current char */
void updateOverviewChars(uint unicode);
......
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