aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/datasource/sqlquerymodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/datasource/sqlquerymodel.cpp')
-rw-r--r--plugins/datasource/sqlquerymodel.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/datasource/sqlquerymodel.cpp b/plugins/datasource/sqlquerymodel.cpp
index 2cc2684..0bb4f15 100644
--- a/plugins/datasource/sqlquerymodel.cpp
+++ b/plugins/datasource/sqlquerymodel.cpp
@@ -39,9 +39,8 @@ SqlQueryModel::SqlQueryModel(QObject *parent) :
void SqlQueryModel::updateRoleNames()
{
m_roleNames.clear();
- for (int i = 0; i < record().count(); i++) {
+ for (int i = 0; i < record().count(); i++)
m_roleNames[Qt::UserRole + i + 1] = record().fieldName(i).toLatin1();
- }
}
QHash<int, QByteArray> SqlQueryModel::roleNames() const
@@ -53,9 +52,8 @@ QVariantMap SqlQueryModel::get(int row) const
{
QVariantMap map;
QModelIndex index = createIndex(row, 0);
- foreach (int role, m_roleNames.keys()) {
+ foreach (int role, m_roleNames.keys())
map.insert(m_roleNames.value(role), data(index, role));
- }
return map;
}