summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/databaseinfo.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-05-31 09:03:20 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-06-02 10:30:47 +0000
commit5b99ac4eadfcc7c2cffce606c21415a242d8a83e (patch)
tree6761ed88649b489ca0944a0dca0dc990e11fdf38 /src/tools/uic/databaseinfo.cpp
parentf68e4b8c315d4d370e3418a7ad736783828a46bb (diff)
uic: standardize property lookups on QHash::value()
This is the pattern used throughout the rest of the uic codebase, and is both more efficient (one lookup instead of two with an additional contains() call) and will allow porting to another container. In writeSpacerItem(), also gently optimize string handling. Change-Id: I20c7914089a699d2161d648b16d938e3a001ace3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/tools/uic/databaseinfo.cpp')
-rw-r--r--src/tools/uic/databaseinfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/uic/databaseinfo.cpp b/src/tools/uic/databaseinfo.cpp
index 73fcf06c54..fa5d5f5df0 100644
--- a/src/tools/uic/databaseinfo.cpp
+++ b/src/tools/uic/databaseinfo.cpp
@@ -52,11 +52,11 @@ void DatabaseInfo::acceptWidget(DomWidget *node)
{
QHash<QString, DomProperty*> properties = propertyMap(node->elementProperty());
- DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0);
+ DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"));
if (frameworkCode && toBool(frameworkCode->elementBool()) == false)
return;
- DomProperty *db = properties.value(QLatin1String("database"), 0);
+ DomProperty *db = properties.value(QLatin1String("database"));
if (db && db->elementStringList()) {
QStringList info = db->elementStringList()->elementString();