Commit 56d874b1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some clazy warning

parent 9f9fdb13
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
static QString intPairListToString(const QVariant &var) static QString intPairListToString(const QVariant &var)
{ {
auto arg = var.value<QList<QPair<int, int>>>(); const auto arg = var.value<QList<QPair<int, int>>>();
QString ret; QString ret;
for (const auto &pair : arg) { for (const auto &pair : arg) {
if (!ret.isEmpty()) { if (!ret.isEmpty()) {
......
...@@ -65,7 +65,7 @@ DbConsole::DbConsole(QWidget *parent) ...@@ -65,7 +65,7 @@ DbConsole::DbConsole(QWidget *parent)
queries = group.readEntry("queryTexts", QStringList()); queries = group.readEntry("queryTexts", QStringList());
} }
for (const auto &query : queries) { for (const auto &query : qAsConst(queries)) {
auto tab = addTab(); auto tab = addTab();
tab->setQuery(query); tab->setQuery(query);
} }
......
...@@ -65,7 +65,7 @@ QString DebugModel::cacheString(const QString &str, QMap<QString, QString> &cach ...@@ -65,7 +65,7 @@ QString DebugModel::cacheString(const QString &str, QMap<QString, QString> &cach
return identifier; return identifier;
} else if (cache[identifier].isEmpty()) { } else if (cache[identifier].isEmpty()) {
cache[identifier] = name; cache[identifier] = name;
auto item = model->findItems(identifier).first(); const auto item = model->findItems(identifier).constFirst();
item->setData(displaySender(identifier), Qt::DisplayRole); item->setData(displaySender(identifier), Qt::DisplayRole);
} }
return identifier; return identifier;
...@@ -93,7 +93,7 @@ bool DebugModel::removeRows(int row, int count, const QModelIndex& parent) ...@@ -93,7 +93,7 @@ bool DebugModel::removeRows(int row, int count, const QModelIndex& parent)
// find elements that needs to be deleted. // find elements that needs to be deleted.
for(const auto &identifer: mSenderCache.keys()) { for(const auto &identifer: mSenderCache.keys()) {
bool found = false; bool found = false;
for(const auto &msg: mMessages) { for(const auto &msg: qAsConst(mMessages)) {
if (msg.sender == identifer) { if (msg.sender == identifer) {
found = true; found = true;
break; break;
......
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