diff options
author | Alessandro Portale <aportale@trolltech.com> | 2009-05-19 17:13:39 (GMT) |
---|---|---|
committer | Alessandro Portale <aportale@trolltech.com> | 2009-05-19 17:16:53 (GMT) |
commit | 515916da3ddd0e7a7fc1b7c4e6d2e17d3576b803 (patch) | |
tree | ef1b901b35f5bc5fdcc7a1ca25b27281d2afabce | |
parent | 2f37788e164bcf4c179e5603c1e9d9a5c5bcd6cc (diff) | |
download | Qt-515916da3ddd0e7a7fc1b7c4e6d2e17d3576b803.zip Qt-515916da3ddd0e7a7fc1b7c4e6d2e17d3576b803.tar.gz Qt-515916da3ddd0e7a7fc1b7c4e6d2e17d3576b803.tar.bz2 |
Testing 'dictionary' if it contains a value before using operator[].
T & QMap::operator[]: "If the map contains no item with key key, the
function inserts a default-constructed value into the map with key key,
and returns a reference to it"
How many occurences of 'dictionary["foo"].startsWith("bar")' has that
file by the way?
-rw-r--r-- | tools/configure/configureapp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 2c20d51..a879e5d 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1886,14 +1886,14 @@ bool Configure::checkAvailability(const QString &part) else if (part == "SQL_DB2") available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib"); else if (part == "SQL_SQLITE") - if (dictionary["XQMAKESPEC"].startsWith("symbian")) + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) available = false; // In Symbian we only support system sqlite option else available = true; // Built in, we have a fork else if (part == "SQL_SQLITE_LIB") { if (dictionary[ "SQL_SQLITE_LIB" ] == "system") { // Symbian has multiple .lib/.dll files we need to find - if (dictionary["XQMAKESPEC"].startsWith("symbian")) { + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { available = true; // There is sqlite_symbian plugin which exports the necessary stuff dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3"; } else { |