diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-05-31 09:03:20 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-06-02 10:30:47 +0000 |
commit | 5b99ac4eadfcc7c2cffce606c21415a242d8a83e (patch) | |
tree | 6761ed88649b489ca0944a0dca0dc990e11fdf38 /src/tools/uic/databaseinfo.cpp | |
parent | f68e4b8c315d4d370e3418a7ad736783828a46bb (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.cpp | 4 |
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(); |