summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2023-12-20 13:49:03 +0100
committerDominik Holland <dominik.holland@qt.io>2024-01-29 15:41:33 +0100
commit154cbc4344f102fb58d1ffa294f40de8e38932c2 (patch)
tree368c4f7a6cc35e98ad9fcaade7d2c3ad5a3ebc71
parent4d0f10e8a05efb151e04c01dd1de981b4135df49 (diff)
Fix problems found by the static code analyzer
Pick-to: 6.7 6.6 6.5 Change-Id: I46cace14654cfb679457d427df029752d95d2dcc Reviewed-by: Robert Griebl <robert.griebl@qt.io>
-rw-r--r--src/interfaceframework/qifconfiguration.cpp14
-rw-r--r--src/interfaceframework/qifconfiguration_p.h2
-rw-r--r--src/interfaceframework/qiffilterandbrowsemodel.cpp8
-rw-r--r--src/interfaceframework/qiffilterandbrowsemodel.h8
-rw-r--r--src/interfaceframework/qiffilterandbrowsemodel_p.h8
-rw-r--r--src/interfaceframework/qifpagingmodel.cpp8
-rw-r--r--src/interfaceframework/qifpagingmodel.h8
-rw-r--r--src/interfaceframework/qifpagingmodel_p.h8
-rw-r--r--src/interfaceframework/qifproxyserviceobject.cpp10
-rw-r--r--src/interfaceframework/qifproxyserviceobject.h4
-rw-r--r--src/interfaceframework/qifqmlconversion_helper.cpp14
-rw-r--r--src/interfaceframework/qifserviceinterface.h1
-rw-r--r--src/interfaceframework/qifservicemanager.cpp2
-rw-r--r--src/interfaceframework/qifservicemanager_p.h2
-rw-r--r--src/interfaceframework/qifsimulationengine.cpp8
-rw-r--r--src/interfaceframework/qifsimulationglobalobject.cpp7
-rw-r--r--src/interfaceframework/queryparser/qifqueryparser_p.h3
17 files changed, 59 insertions, 56 deletions
diff --git a/src/interfaceframework/qifconfiguration.cpp b/src/interfaceframework/qifconfiguration.cpp
index 19ddf989..8b0b09c0 100644
--- a/src/interfaceframework/qifconfiguration.cpp
+++ b/src/interfaceframework/qifconfiguration.cpp
@@ -41,8 +41,9 @@ QIfConfigurationManager *QIfConfigurationManager::instance()
QIfAbstractFeature::DiscoveryMode discoveryModeFromString(const QString &modeString)
{
QMetaEnum me = QMetaEnum::fromType<QIfAbstractFeature::DiscoveryMode>();
+ QByteArray modeStringUtf8 = modeString.toUtf8();
bool ok = false;
- int value = me.keyToValue(modeString.toUtf8().constData(), &ok);
+ int value = me.keyToValue(modeStringUtf8, &ok);
if (ok) {
return static_cast<QIfAbstractFeature::DiscoveryMode>(value);
} else {
@@ -63,9 +64,11 @@ QVariantMap QIfConfigurationManager::readGroup(QSettings *settings, QAnyStringVi
{
QVariantMap map;
settings->beginGroup(group);
- for (const QString& key : settings->childKeys())
+ const auto keys = settings->childKeys();
+ const auto groups = settings->childGroups();
+ for (const QString& key : keys)
map.insert(key, settings->value(key));
- for (const QString& group : settings->childGroups())
+ for (const QString& group : groups)
map.insert(group, readGroup(settings, group));
settings->endGroup();
return map;
@@ -77,7 +80,8 @@ void QIfConfigurationManager::readInitialSettings(const QString &configPath)
QSettings settings(configPath, QSettings::IniFormat);
- for (const QString& group : settings.childGroups()) {
+ const auto groups = settings.childGroups();
+ for (const QString& group : groups) {
auto settingsObject = new QIfSettingsObject;
settings.beginGroup(group);
@@ -318,7 +322,7 @@ bool QIfConfigurationManager::setServiceObject(QIfSettingsObject *so, QIfService
return true;
}
-void QIfConfigurationManager::parseEnv(const QByteArray &rulesSrc, std::function<void(const QString &, const QString &)> func)
+void QIfConfigurationManager::parseEnv(const QByteArray &rulesSrc, const std::function<void(const QString &, const QString &)> &func)
{
const QString content = QString::fromLocal8Bit(rulesSrc);
const auto lines = content.split(QLatin1Char(';'));
diff --git a/src/interfaceframework/qifconfiguration_p.h b/src/interfaceframework/qifconfiguration_p.h
index b3013581..f8e1ed5b 100644
--- a/src/interfaceframework/qifconfiguration_p.h
+++ b/src/interfaceframework/qifconfiguration_p.h
@@ -70,7 +70,7 @@ public:
bool setServiceObject(QIfSettingsObject *so, QIfServiceObject *serviceObject);
QVariantMap readGroup(QSettings *settings, QAnyStringView group);
- void parseEnv(const QByteArray &rulesSrc, std::function<void(const QString &, const QString &)> func);
+ void parseEnv(const QByteArray &rulesSrc, const std::function<void (const QString &, const QString &)> &func);
QHash<QString, QIfSettingsObject*> m_settingsHash;
QHash<QString, QIfConfiguration*> m_configurationHash;
diff --git a/src/interfaceframework/qiffilterandbrowsemodel.cpp b/src/interfaceframework/qiffilterandbrowsemodel.cpp
index f804e98c..abc9ebd7 100644
--- a/src/interfaceframework/qiffilterandbrowsemodel.cpp
+++ b/src/interfaceframework/qiffilterandbrowsemodel.cpp
@@ -107,7 +107,7 @@ void QIfFilterAndBrowseModelPrivate::clearToDefaults()
QIfPagingModelPrivate::resetModel();
}
-void QIfFilterAndBrowseModelPrivate::onCanGoForwardChanged(const QUuid &identifier, const QVector<bool> &indexes, int start)
+void QIfFilterAndBrowseModelPrivate::onCanGoForwardChanged(QUuid identifier, const QVector<bool> &indexes, int start)
{
if (m_identifier != identifier)
return;
@@ -120,7 +120,7 @@ void QIfFilterAndBrowseModelPrivate::onCanGoForwardChanged(const QUuid &identifi
m_canGoForward[start + i] = indexes.at(i);
}
-void QIfFilterAndBrowseModelPrivate::onCanGoBackChanged(const QUuid &identifier, bool canGoBack)
+void QIfFilterAndBrowseModelPrivate::onCanGoBackChanged(QUuid identifier, bool canGoBack)
{
if (m_identifier != identifier)
return;
@@ -133,7 +133,7 @@ void QIfFilterAndBrowseModelPrivate::onCanGoBackChanged(const QUuid &identifier,
emit q->canGoBackChanged(m_canGoBack);
}
-void QIfFilterAndBrowseModelPrivate::onContentTypeChanged(const QUuid &identifier, const QString &contentType)
+void QIfFilterAndBrowseModelPrivate::onContentTypeChanged(QUuid identifier, const QString &contentType)
{
if (m_identifier != identifier)
return;
@@ -160,7 +160,7 @@ void QIfFilterAndBrowseModelPrivate::onAvailableContentTypesChanged(const QStrin
emit q->availableContentTypesChanged(contentTypes);
}
-void QIfFilterAndBrowseModelPrivate::onQueryIdentifiersChanged(const QUuid &identifier, const QSet<QString> &queryIdentifiers)
+void QIfFilterAndBrowseModelPrivate::onQueryIdentifiersChanged(QUuid identifier, const QSet<QString> &queryIdentifiers)
{
if (m_identifier != identifier)
return;
diff --git a/src/interfaceframework/qiffilterandbrowsemodel.h b/src/interfaceframework/qiffilterandbrowsemodel.h
index 5a7b2ea4..a44fd88e 100644
--- a/src/interfaceframework/qiffilterandbrowsemodel.h
+++ b/src/interfaceframework/qiffilterandbrowsemodel.h
@@ -78,10 +78,10 @@ protected:
private:
Q_DECLARE_PRIVATE(QIfFilterAndBrowseModel)
- Q_PRIVATE_SLOT(d_func(), void onCanGoForwardChanged(const QUuid &identifier, const QVector<bool> &indexes, int start))
- Q_PRIVATE_SLOT(d_func(), void onCanGoBackChanged(const QUuid &identifier, bool canGoBack))
- Q_PRIVATE_SLOT(d_func(), void onQueryIdentifiersChanged(const QUuid &identifier, const QSet<QString> &queryIdentifiers))
- Q_PRIVATE_SLOT(d_func(), void onContentTypeChanged(const QUuid &identifier, const QString &contentType))
+ Q_PRIVATE_SLOT(d_func(), void onCanGoForwardChanged(QUuid identifier, const QVector<bool> &indexes, int start))
+ Q_PRIVATE_SLOT(d_func(), void onCanGoBackChanged(QUuid identifier, bool canGoBack))
+ Q_PRIVATE_SLOT(d_func(), void onQueryIdentifiersChanged(QUuid identifier, const QSet<QString> &queryIdentifiers))
+ Q_PRIVATE_SLOT(d_func(), void onContentTypeChanged(QUuid identifier, const QString &contentType))
Q_PRIVATE_SLOT(d_func(), void onAvailableContentTypesChanged(const QStringList &contentTypes))
};
diff --git a/src/interfaceframework/qiffilterandbrowsemodel_p.h b/src/interfaceframework/qiffilterandbrowsemodel_p.h
index c7090225..1264bbad 100644
--- a/src/interfaceframework/qiffilterandbrowsemodel_p.h
+++ b/src/interfaceframework/qiffilterandbrowsemodel_p.h
@@ -40,11 +40,11 @@ public:
void parseQuery();
void setupFilter(QIfAbstractQueryTerm* queryTerm, const QList<QIfOrderTerm> &orderTerms);
void clearToDefaults() override;
- void onCanGoForwardChanged(const QUuid &identifier, const QVector<bool> &indexes, int start);
- void onCanGoBackChanged(const QUuid &identifier, bool canGoBack);
- void onContentTypeChanged(const QUuid &identifier, const QString &contentType);
+ void onCanGoForwardChanged(QUuid identifier, const QVector<bool> &indexes, int start);
+ void onCanGoBackChanged(QUuid identifier, bool canGoBack);
+ void onContentTypeChanged(QUuid identifier, const QString &contentType);
void onAvailableContentTypesChanged(const QStringList &contentTypes);
- void onQueryIdentifiersChanged(const QUuid &identifier, const QSet<QString> &queryIdentifiers);
+ void onQueryIdentifiersChanged(QUuid identifier, const QSet<QString> &queryIdentifiers);
QIfFilterAndBrowseModelInterface *searchBackend() const;
void updateContentType(const QString &contentType);
diff --git a/src/interfaceframework/qifpagingmodel.cpp b/src/interfaceframework/qifpagingmodel.cpp
index 6a0fdbf6..1c5bac7f 100644
--- a/src/interfaceframework/qifpagingmodel.cpp
+++ b/src/interfaceframework/qifpagingmodel.cpp
@@ -65,7 +65,7 @@ void QIfPagingModelPrivate::onInitializationDone()
resetModel();
}
-void QIfPagingModelPrivate::onCapabilitiesChanged(const QUuid &identifier, QtInterfaceFrameworkModule::ModelCapabilities capabilities)
+void QIfPagingModelPrivate::onCapabilitiesChanged(QUuid identifier, QtInterfaceFrameworkModule::ModelCapabilities capabilities)
{
if (!identifier.isNull() && identifier != m_identifier)
return;
@@ -78,7 +78,7 @@ void QIfPagingModelPrivate::onCapabilitiesChanged(const QUuid &identifier, QtInt
emit q->capabilitiesChanged(capabilities);
}
-void QIfPagingModelPrivate::onDataFetched(const QUuid &identifier, const QList<QVariant> &items, int start, bool moreAvailable)
+void QIfPagingModelPrivate::onDataFetched(QUuid identifier, const QList<QVariant> &items, int start, bool moreAvailable)
{
if (!identifier.isNull() && (!items.count() || identifier != m_identifier))
return;
@@ -112,7 +112,7 @@ void QIfPagingModelPrivate::onDataFetched(const QUuid &identifier, const QList<Q
}
}
-void QIfPagingModelPrivate::onCountChanged(const QUuid &identifier, int new_length)
+void QIfPagingModelPrivate::onCountChanged(QUuid identifier, int new_length)
{
if (m_loadingType != QIfPagingModel::DataChanged || (!identifier.isNull() && identifier != m_identifier) || m_itemList.count() == new_length)
return;
@@ -126,7 +126,7 @@ void QIfPagingModelPrivate::onCountChanged(const QUuid &identifier, int new_leng
m_availableChunks.resize(new_length / m_chunkSize + 1);
}
-void QIfPagingModelPrivate::onDataChanged(const QUuid &identifier, const QList<QVariant> &data, int start, int count)
+void QIfPagingModelPrivate::onDataChanged(QUuid identifier, const QList<QVariant> &data, int start, int count)
{
if (!identifier.isNull() && identifier != m_identifier)
return;
diff --git a/src/interfaceframework/qifpagingmodel.h b/src/interfaceframework/qifpagingmodel.h
index b23bea75..358d77b1 100644
--- a/src/interfaceframework/qifpagingmodel.h
+++ b/src/interfaceframework/qifpagingmodel.h
@@ -88,10 +88,10 @@ protected:
private:
Q_DECLARE_PRIVATE(QIfPagingModel)
- Q_PRIVATE_SLOT(d_func(), void onCapabilitiesChanged(const QUuid &identifier, QtInterfaceFrameworkModule::ModelCapabilities capabilities))
- Q_PRIVATE_SLOT(d_func(), void onDataFetched(const QUuid &identifer, const QList<QVariant> &items, int start, bool moreAvailable))
- Q_PRIVATE_SLOT(d_func(), void onCountChanged(const QUuid &identifier, int new_length))
- Q_PRIVATE_SLOT(d_func(), void onDataChanged(const QUuid &identifier, const QList<QVariant> &data, int start, int count))
+ Q_PRIVATE_SLOT(d_func(), void onCapabilitiesChanged(QUuid identifier, QtInterfaceFrameworkModule::ModelCapabilities capabilities))
+ Q_PRIVATE_SLOT(d_func(), void onDataFetched(QUuid identifer, const QList<QVariant> &items, int start, bool moreAvailable))
+ Q_PRIVATE_SLOT(d_func(), void onCountChanged(QUuid identifier, int new_length))
+ Q_PRIVATE_SLOT(d_func(), void onDataChanged(QUuid identifier, const QList<QVariant> &data, int start, int count))
Q_PRIVATE_SLOT(d_func(), void onFetchMoreThresholdReached())
};
diff --git a/src/interfaceframework/qifpagingmodel_p.h b/src/interfaceframework/qifpagingmodel_p.h
index 322916d2..b35539ca 100644
--- a/src/interfaceframework/qifpagingmodel_p.h
+++ b/src/interfaceframework/qifpagingmodel_p.h
@@ -37,10 +37,10 @@ public:
void initialize() override;
void onInitializationDone();
- void onCapabilitiesChanged(const QUuid &identifier, QtInterfaceFrameworkModule::ModelCapabilities capabilities);
- void onDataFetched(const QUuid &identifier, const QList<QVariant> &items, int start, bool moreAvailable);
- void onCountChanged(const QUuid &identifier, int new_length);
- void onDataChanged(const QUuid &identifier, const QList<QVariant> &data, int start, int count);
+ void onCapabilitiesChanged(QUuid identifier, QtInterfaceFrameworkModule::ModelCapabilities capabilities);
+ void onDataFetched(QUuid identifier, const QList<QVariant> &items, int start, bool moreAvailable);
+ void onCountChanged(QUuid identifier, int new_length);
+ void onDataChanged(QUuid identifier, const QList<QVariant> &data, int start, int count);
void onFetchMoreThresholdReached();
virtual void resetModel();
virtual void clearToDefaults();
diff --git a/src/interfaceframework/qifproxyserviceobject.cpp b/src/interfaceframework/qifproxyserviceobject.cpp
index a4a7cef0..da4e8631 100644
--- a/src/interfaceframework/qifproxyserviceobject.cpp
+++ b/src/interfaceframework/qifproxyserviceobject.cpp
@@ -43,12 +43,14 @@ QIfProxyServiceObjectPrivate::QIfProxyServiceObjectPrivate(const QHash<QString,
/*!
Creates a new QIfProxyServiceObject for the given \a interface.
+ The \a parent argument is sent to the QIfServiceObject constructor.
+
This can be used to load a backend which is derived from QIfServiceInterface and supposed to
be loaded as a plugin, but is part of the same library and can be loaded directly instead. e.g.
within a autotest
*/
-QIfProxyServiceObject::QIfProxyServiceObject(QIfServiceInterface *interface)
- : QIfServiceObject()
+QIfProxyServiceObject::QIfProxyServiceObject(QIfServiceInterface *interface, QObject *parent)
+ : QIfServiceObject(parent)
, d_ptr(new QIfProxyServiceObjectPrivate(interface))
{
}
@@ -59,8 +61,8 @@ QIfProxyServiceObject::QIfProxyServiceObject(QIfServiceInterface *interface)
This can be used to directly connect a feature class to the backend implementing the
QIfFeatureInterface.
*/
-QIfProxyServiceObject::QIfProxyServiceObject(const QHash<QString, QIfFeatureInterface*> &interfaceMap)
- : QIfServiceObject()
+QIfProxyServiceObject::QIfProxyServiceObject(const QHash<QString, QIfFeatureInterface*> &interfaceMap, QObject *parent)
+ : QIfServiceObject(parent)
, d_ptr(new QIfProxyServiceObjectPrivate(interfaceMap))
{
}
diff --git a/src/interfaceframework/qifproxyserviceobject.h b/src/interfaceframework/qifproxyserviceobject.h
index 87429d18..ac4d220b 100644
--- a/src/interfaceframework/qifproxyserviceobject.h
+++ b/src/interfaceframework/qifproxyserviceobject.h
@@ -20,8 +20,8 @@ class Q_QTINTERFACEFRAMEWORK_EXPORT QIfProxyServiceObject : public QIfServiceObj
Q_OBJECT
public:
- explicit QIfProxyServiceObject(QIfServiceInterface *interface);
- explicit QIfProxyServiceObject(const QHash<QString, QIfFeatureInterface*> &interfaceMap);
+ explicit QIfProxyServiceObject(QIfServiceInterface *interface, QObject *parent = nullptr);
+ explicit QIfProxyServiceObject(const QHash<QString, QIfFeatureInterface*> &interfaceMap, QObject *parent = nullptr);
QStringList interfaces() const override;
QIfFeatureInterface *interfaceInstance(const QString &interface) const override;
diff --git a/src/interfaceframework/qifqmlconversion_helper.cpp b/src/interfaceframework/qifqmlconversion_helper.cpp
index b4f31fd3..3b62c2f0 100644
--- a/src/interfaceframework/qifqmlconversion_helper.cpp
+++ b/src/interfaceframework/qifqmlconversion_helper.cpp
@@ -14,13 +14,6 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
-namespace qtif_helper {
- static const QString valueLiteral = u"value"_s;
- static const QString typeLiteral = u"type"_s;
-}
-
-using namespace qtif_helper;
-
void qtif_qmlOrCppWarning(const QObject *obj, const char *errorString)
{
qtif_qmlOrCppWarning(obj, QLatin1String(errorString));
@@ -67,6 +60,9 @@ void qtif_qmlOrCppWarning(const QObject *obj, const QString &errorString)
*/
QVariant qtif_convertFromJSON(const QVariant &value)
{
+ static const QString valueLiteral = u"value"_s;
+ static const QString typeLiteral = u"type"_s;
+
QVariant val = value;
// First try to convert the values to a Map or a List
// This is needed as it could also store a QStringList or a Hash
@@ -85,7 +81,7 @@ QVariant qtif_convertFromJSON(const QVariant &value)
QString enumValue = value.toString();
const int lastIndex = int(enumValue.lastIndexOf(u"::"_s));
const QString className = enumValue.left(lastIndex) + u"*"_s;
- enumValue = enumValue.right(enumValue.size() - lastIndex - 2);
+ QByteArray enumValueUtf8 = enumValue.right(enumValue.size() - lastIndex - 2).toUtf8();
QMetaType metaType = QMetaType::fromName(className.toLatin1());
const QMetaObject *mo = metaType.metaObject();
if (Q_UNLIKELY(!mo)) {
@@ -98,7 +94,7 @@ QVariant qtif_convertFromJSON(const QVariant &value)
for (int i = mo->enumeratorOffset(); i < mo->enumeratorCount(); ++i) {
QMetaEnum me = mo->enumerator(i);
bool ok = false;
- int value = me.keysToValue(enumValue.toLatin1(), &ok);
+ int value = me.keysToValue(enumValueUtf8, &ok);
if (ok) {
return QVariant(QMetaType::fromName((QLatin1String(me.scope()) + u"::"_s + QLatin1String(me.enumName())).toLatin1()), &value);
}
diff --git a/src/interfaceframework/qifserviceinterface.h b/src/interfaceframework/qifserviceinterface.h
index a6c39789..8ee21c16 100644
--- a/src/interfaceframework/qifserviceinterface.h
+++ b/src/interfaceframework/qifserviceinterface.h
@@ -43,6 +43,7 @@ public:
T inst = qif_interface_cast<T>(interfaceInstance(interfaceName));
return inst;
}
+
};
#define QIfServiceInterface_iid "org.qt-project.interfaceframework.QIfServiceInterface/1.0"
diff --git a/src/interfaceframework/qifservicemanager.cpp b/src/interfaceframework/qifservicemanager.cpp
index 94407634..a69daa68 100644
--- a/src/interfaceframework/qifservicemanager.cpp
+++ b/src/interfaceframework/qifservicemanager.cpp
@@ -249,7 +249,7 @@ void QIfServiceManagerPrivate::registerBackend(const QString &fileName, const QJ
addBackend(backend);
}
-void QIfServiceManagerPrivate::registerStaticBackend(QStaticPlugin plugin)
+void QIfServiceManagerPrivate::registerStaticBackend(const QStaticPlugin &plugin)
{
QVariantMap backendMetaData = plugin.metaData().value(metaDataLiteral).toVariant().toMap();
const char* pluginName = plugin.instance()->metaObject()->className();
diff --git a/src/interfaceframework/qifservicemanager_p.h b/src/interfaceframework/qifservicemanager_p.h
index 2c69ad1a..aa8dd25a 100644
--- a/src/interfaceframework/qifservicemanager_p.h
+++ b/src/interfaceframework/qifservicemanager_p.h
@@ -61,7 +61,7 @@ public:
QList<QIfServiceObject*> findServiceByInterface(const QString &interface, QIfServiceManager::SearchFlags searchFlags, const QStringList &preferredBackends) const;
void searchPlugins();
- void registerStaticBackend(QStaticPlugin plugin);
+ void registerStaticBackend(const QStaticPlugin &plugin);
void registerBackend(const QString &fileName, const QJsonObject &metaData);
bool registerBackend(QObject *serviceBackendInterface, const QStringList &interfaces, QIfServiceManager::BackendType backendType);
void addBackend(struct Backend *backend);
diff --git a/src/interfaceframework/qifsimulationengine.cpp b/src/interfaceframework/qifsimulationengine.cpp
index eadf62f0..47a44f8d 100644
--- a/src/interfaceframework/qifsimulationengine.cpp
+++ b/src/interfaceframework/qifsimulationengine.cpp
@@ -20,11 +20,11 @@ using namespace Qt::StringLiterals;
QT_BEGIN_NAMESPACE
namespace qtif_helper {
- static const QString qrcUrlLiteral = u"qrc:"_s;
- static const QString qrcLiteral = u"qrc"_s;
- static const QString resourceLiteral = u":/"_s;
-
QUrl toQmlUrl(const QString &path) {
+ static const QString qrcUrlLiteral = u"qrc:"_s;
+ static const QString qrcLiteral = u"qrc"_s;
+ static const QString resourceLiteral = u":/"_s;
+
if (path.startsWith(qrcUrlLiteral))
return path;
else if (path.startsWith(resourceLiteral))
diff --git a/src/interfaceframework/qifsimulationglobalobject.cpp b/src/interfaceframework/qifsimulationglobalobject.cpp
index bdbc91bd..ef797728 100644
--- a/src/interfaceframework/qifsimulationglobalobject.cpp
+++ b/src/interfaceframework/qifsimulationglobalobject.cpp
@@ -289,15 +289,16 @@ QVariantMap QIfSimulationGlobalObject::findData(const QVariantMap &data, const Q
void QIfSimulationGlobalObject::initializeDefault(const QVariantMap &data, QObject *object)
{
for (auto i = data.constBegin(); i != data.constEnd(); ++i) {
+ QByteArray key = i.key().toLatin1();
const QVariant defVal = defaultValue(i.value().toMap());
if (defVal.isValid()) {
- QVariant currentValue = object->property(i.key().toLatin1());
+ QVariant currentValue = object->property(key);
if (QIfPagingModelInterface *model = currentValue.value<QIfPagingModelInterface*>()) {
QVariantList list = defVal.toList();
for (auto i = list.crbegin(); i != list.crend(); ++i)
QMetaObject::invokeMethod(model, "insert", createArgument(int(0)), createArgument(*i));
} else {
- object->setProperty(i.key().toLatin1(), defVal);
+ object->setProperty(key, defVal);
}
}
@@ -311,7 +312,7 @@ void QIfSimulationGlobalObject::initializeDefault(const QVariantMap &data, QObje
if (defVal.isValid()) {
QObject *zoneObject = map->value(zone).value<QObject*>();
if (zoneObject)
- zoneObject->setProperty(i.key().toLatin1(), defVal);
+ zoneObject->setProperty(key, defVal);
}
}
}
diff --git a/src/interfaceframework/queryparser/qifqueryparser_p.h b/src/interfaceframework/queryparser/qifqueryparser_p.h
index de192648..b8cf2f85 100644
--- a/src/interfaceframework/queryparser/qifqueryparser_p.h
+++ b/src/interfaceframework/queryparser/qifqueryparser_p.h
@@ -99,7 +99,6 @@ protected:
QList<QIfOrderTerm> m_orderList;
};
-#endif // QTIFQUERYPARSER_P_H
-
QT_END_NAMESPACE
+#endif // QTIFQUERYPARSER_P_H