Commit 460b6905 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

port some foreach + add const

parent 3869ddc3
......@@ -266,8 +266,8 @@ void MolcalcWidget::keyPressEvent(QKeyEvent * /* e */)
void MolcalcWidget::addAlias()
{
QString shortForm = ui.shortForm->text();
QString fullForm = ui.fullForm ->text();
const QString shortForm = ui.shortForm->text();
const QString fullForm = ui.fullForm ->text();
// Validate the alias
double x;
......
......@@ -200,14 +200,14 @@ void RSDialog::createSPhrases()
QRegularExpression reg("(R|S)(\\d+): (.*)");
foreach (const QString &p, sphrases) {
for (const QString &p : std::as_const(sphrases)) {
int number = 0;
QString phrase(QLatin1String(""));
QRegularExpressionMatch match = reg.match(p);
if (match.hasMatch()) {
QString part1 = match.captured(2);
QString part2 = match.captured(3);
const QString part1 = match.captured(2);
const QString part2 = match.captured(3);
phrase = part2;
number = part1.toInt();
......@@ -289,14 +289,14 @@ void RSDialog::createRPhrases()
QRegularExpression reg("(R|S)(\\d+): (.*)");
foreach (const QString &p, rphrases) {
for (const QString &p : std::as_const(rphrases)) {
int number = 0;
QString phrase(QLatin1String(""));
QRegularExpressionMatch match = reg.match(p);
if (match.hasMatch()) {
QString part1 = match.captured(2);
QString part2 = match.captured(3);
const QString part1 = match.captured(2);
const QString part2 = match.captured(3);
phrase = part2;
number = part1.toInt();
......
......@@ -92,7 +92,7 @@ signals:
void searchReset();
private:
bool m_isActive;
bool m_isActive = false;
QString m_searchText;
SearchKind m_searchKind;
......
Supports Markdown
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