mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:13:25 +00:00
C++ Correctness and code cleanup.
Use const-reference where we can gain a bit of speed from that and clear an else { if {}} by using else if. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8c8657f996
commit
357f5c19da
2 changed files with 5 additions and 7 deletions
|
@ -106,7 +106,7 @@ void GroupedLineEdit::removeAllColors()
|
|||
QStringList GroupedLineEdit::getBlockStringList()
|
||||
{
|
||||
QStringList retList;
|
||||
foreach (Private::Block block, d->blocks)
|
||||
foreach (const Private::Block &block, d->blocks)
|
||||
retList.append(block.text);
|
||||
return retList;
|
||||
}
|
||||
|
|
|
@ -1025,18 +1025,16 @@ void MainWindow::removeRecentFile(QStringList failedFiles)
|
|||
}
|
||||
}
|
||||
|
||||
foreach (QString file, failedFiles)
|
||||
foreach (const QString &file, failedFiles)
|
||||
files.removeAll(file);
|
||||
|
||||
for (int c = 1; c <= 4; c++) {
|
||||
QString key = QString("File_%1").arg(c);
|
||||
|
||||
if (files.count() >= c) {
|
||||
if (files.count() >= c)
|
||||
s.setValue(key, files.at(c - 1));
|
||||
} else {
|
||||
if (s.contains(key))
|
||||
s.remove(key);
|
||||
}
|
||||
else if (s.contains(key))
|
||||
s.remove(key);
|
||||
}
|
||||
|
||||
s.endGroup();
|
||||
|
|
Loading…
Add table
Reference in a new issue