summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Portale <aportale@trolltech.com>2009-05-19 17:13:39 (GMT)
committerAlessandro Portale <aportale@trolltech.com>2009-05-19 17:13:39 (GMT)
commiteb4c00a469f473a33103652ed977eabb4fb9ce9b (patch)
tree9438444c90634da922aabb8dbd2e5673242c74aa
parent40fc74c780be1069ed6e7f8cf7e4ac3c70d4c20c (diff)
downloadQt-eb4c00a469f473a33103652ed977eabb4fb9ce9b.zip
Qt-eb4c00a469f473a33103652ed977eabb4fb9ce9b.tar.gz
Qt-eb4c00a469f473a33103652ed977eabb4fb9ce9b.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.cpp4
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 {