Add unit test to ensure %3A in a path isn't decoded to ':'

QUrl("http%3A%2F%2Fexample.com") has only a path of
"http%3A%2F%2Fexample.com". In Qt 5.0 and 5.1, the %3A would get decoded
to ':', which in turn makes the URL invalid (colon before first slash).

Found via discussion on the interest mailing list.

Change-Id: I7f4f242b330df280e635eb97cce123e742aa1b10
Reviewed-by: David Faure <david.faure@kdab.com>
QThreadPool: fix counting of waiting threads

QTBUG-21051 has a testcase where activeThreadCount() could actually
end up at -1 (converted to an autotest in this commit).
The reason was: start() calls tryStart() which returns false due to
too many active threads (reserveThread() causes this), so it calls
enqueueTask() - which actually wakes up the waiting thread, but
it didn't decrement the number of waiting threads.

Note that tryStart() is "if I can grab a waiting thread, enqueue task and wake it"
while start(), in case tryStart() fails, wants to "enqueue, and then if I can grab
a waiting thread, wake it". This is why enqueue shouldn't wake; waking must happen
only if we can grab a thread (d->waitingThreads > 0).

Task-number: QTBUG-21051
Change-Id: I3d98337103031c9bdf0bf365295f245be0c66aa7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QHash/QSet - fix QHash::erase when the hash is shared

Before a call to erase on a shared instance would imply that the
item was removed from the shared data (i.e all instances)

This patch improves the behavior to detach and erase the item
specified by the iterator (i.e same behavior as QVector)

Since QSet uses QHash it improves QSet the same way.

Change-Id: I850b1efcf7bdfc85ceddb23128b048af95f75063
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QMap - fix erase with iterator when the map is shared

Before a call to erase on a shared instance would imply that the
item was removed from the shared data (i.e all instances)

This patch improves the behavior to detach and erase the item
specified by the iterator (i.e same behavior as QVector)

Change-Id: Ia44db84fc1388d92308bf0d2b32539ac4d53850b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QList - fix QList::erase when the list is shared

Before calls to erase on a shared instance would in release mode
imply that items were removed from the shared data (i.e all instances).
In debug mode it would assert.

This patch improves the behavior to detach and erase items
specified by the iterator(s) (i.e same behavior as QVector)

Change-Id: I89b69446cb1ffd43a98402b7ab1ec9a59bceb8e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QLinkedList - fix erase with iterator when the list is shared.

Before a call to erase on a shared instance would imply that the
item was removed from the shared data (i.e all instances)

This patch improves the behavior to detach and erase the item
specified by the iterator (i.e same behavior as QVector)

Change-Id: Ib3cfb5363c86b400886c80b75b0c20ca854ce801
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QList - fix insert with iterator on shared instance

This patch ensures correct detach when insert with an iterator is
called on a shared instance (i.e same behavior as QVector)

Change-Id: Id660eacd3cc7b633456dfa989997bbad747e1df2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QLinkedList - fix insert with iterator when the list is shared.

Before a call to erase on a shared instance would imply that the
item was inserted into the shared data (i.e all instances)

Change-Id: I655ccf04b1ad9bf82e6bfade58929538fa7df000
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove use of QFlag in the SQL drivers

It's not clear why they were added, but they aren't needed anymore.

Change-Id: I1d919deefdbd6a71fa255eeac1a8543c33ba390d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>