Cocoa File Dialog: Remove sandbox-ufriendly QDir::entryList() call

QDir::entryList() uses QDirIterator, which itself uses QFileSystemEngine,
and whose backend uses POSIX API in a relatively liberal way.

This is a backport of Qt 5's Ia872b9b1244f7b390d173a498011379b9309b3c6.

Task-number: QTBUG-34012
Change-Id: I0a17359510e7623b4ee53dd86bb5bdc39785600e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Qt Designer: Implement property() for QAxWidgetPropertySheet.

Access the control property of the QAxWidget directly.

Task-number: QTBUG-34592

Change-Id: I7d0971ad8fc265d0443da7ae72330e2b7f3a8d70
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(cherry picked from qttools/611ac50c1ed80bd6c6c15f2b39e720b6f7c1acb8)
Active Qt: Remove invalid memset()-call.

It uses the wrong size and is not need since the subseqent
memcpy-call overwrites it.

Task-number: QTBUG-34722
Change-Id: Ic1662454cd76a98eff11f52ad6a847c3402e37c3
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Use the correct system font on OS X Mavericks.

Task-number: QTBUG-32789

Change-Id: I7b1988d5f74e5becd2e02274fae4d2bcc8140901
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Update Hebrew translation

Started-by: Diego Iastrubni <diegoiast@gmail.com>
Change-Id: I32932ec0b5b1c96ef5f18da0297ef646c5780c24
Reviewed-by: Genghis Khan <genghiskhan@gmx.ca>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Designer: remove dead code in QStackedWidgetPreviewEventFilter::updateButtonToolTip()

The local variable 'className' is no longer used, since at some point
in time, it was replaced with the query stackedClassName(), a file-
static function.

So remove the code that sets it.

Change-Id: I2ee7dedc66acfa10949b628499c52f87dab02e7a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(cherry picked from qttools/c98012e7a6b6287ec13b8ca4a4d08ed584f7ee8a)
Optimize macDisplayColorSpace

On 10.9, getting the display based on the rect is slow(er).

Use a window -> color space cache instead of a
display -> color space cache.

Change-Id: If40a6d089019a54ceb724b8007adaffea89c96fb
Task-number: QTBUG-34358
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
QWizard: give all buttons an objectName

Only Commit, Finish and Cancel didn't have an object name, yet.
Also Extract Method on the switch statement, add a test, and
use QStringBuilder.

Task-number: QTBUG-29924
Reported-by: Leo Arias

Change-Id: I8c29606bc53e9d4caab631da2089e971a9da2d75
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(cherry picked from qtbase/1ea191276ea49ce2334d21b1f4a2c66ee8889466)
QWizard: provoke 'enum value not handled in switch' warnings in object_name_for_button

This is strictly speaking a behavior change, since we're no longer returning
something for Stretch and NoButton, but - guessing here - that shouldn't matter.
Yet, better safe than sorry, thus submitted as a separate patch.

Change-Id: I20cb084147f8c9257ce37d1e87ea38febabec28d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(cherry picked from qtbase/269590516d89a35ea3121366f7d4bf43b0d391ca)
QThreadPool: fix typos

Task-number: QTBUG-31919
Backport from qtbase/37dc44d499884bd0d7ab9d2f1547db468c9fe53b

Change-Id: I9496b059ed201da6b7a5ec02c4acb8f231e40c30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QThreadPool: fix data races in activeThreadCount()

Rather than trying to make it lock-free (which requires double-bookkeeping of
4 atomic ints!), just lock the mutex before calling it.
tst_bench_qthreadpool shows no difference whatsoever between the two
solutions, I get 0.005 msecs per iteration in startRunnables().

Of course looping over calls to activeThreadCount() is a bit slower,
from 0.0002 msecs per iteration to 0.00027 msecs, i.e. 35% more.
But polling activeThreadCount() from the app is a really wrong thing to
do anyway, this benchmark was just for my own curiosity about the
price of a mutex in a function that sums up 4 ints.
What matters is start() performance, which is unchanged (0.00007 msecs
is just noise compared to a 0.005 total, that's 1.4%).

Backport from qtbase/85b24bb2dea97c3a9b013bacd5a422b26fe5d14b

Change-Id: Id32791069bc1e2dd61cef708d5287c9f9b7e5582
Reviewed-by: Thiago Macieira <thiago.macieira@intel.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
Backport from qtbase/dacf9961da86751a59da0e84bc943fe0d1c8d95b

Change-Id: I1e437da27b733a72b48ff1b6f2b78f81a7ed129b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QThreadPool: fix race at time of thread expiry.

The current synchronization mechanism was racy: decrementing waitingThreads
and then hoping that the wakeOne will wake a thread before its expiry
timeout happens. In other words, on timeout, a just-assigned task would
never run. And then no other task would run, if maxThreadCount is reached.

Fixed by using a queue of waiting threads (rather than just a count), and by
moving the wait condition into the thread itself, so we know precisely
which one we're waking up, and we can remove it from the set of waiting threads
before waking it up, and therefore it can determine on wakeup whether it
has work to do (caller removed it from the queue) or it expired (it's still
in the queue). This is reliable, whereas the return value from QWaitCondition::wait
isn't reliable, when the main thread has already decided that this thread
has work to do.

Task-number: QTBUG-3786
Backport from qtbase/a9b6a78e54670a70b96c122b10ad7bd64d166514

Change-Id: Ic766ff67dea7a8bb8f1bc893943060ee5428d782
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When reparenting a widget, children need to reregister as a drop site

If a widget is a drop site and an ancestor gets reparented then the
widget needs to be reregistered as a drop site so that it is correctly
associated with the new native parent widget.

Task-number: QTBUG-30276

Change-Id: I440077e54f614d0bfbaef46104de6598411c986b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Fully expand entities to ensure deep or widely nested ones fail parsing

With 512a1ce0698d370c313bb561bbf078935fa0342e, we failed when parsing
entities whose partially expanded size was greater than 1024
characters. That was not enough, so now we fully expand all entities.

This is a backport of f1053d94f59f053ce4acad9320df14f1fbe4faac.

Change-Id: I41dd6f4525c63e82fd320a22d19248169627f7e0
Reviewed-by: Richard J. Moore <rich@kde.org>
QObject: use per-thread storage for qFlagLocation()

qFlagLocation() uses a global char* array to transport source location
information from the connect() side to the metaobject side. The size
of the array is 2 (two), which just about suffices for a single connect()
statement.

Obviously, if more than one thread makes a (_any_) connection at the same
time, the data is useless and, worse, there's a data race.

The non-reentrancy of qFlagLocations() cannot and need not be fixed,
but use a per-thread flagged_locations array in QThreadData so threads
don't disturb each other.

Task-number: QTBUG-3680

Change-Id: If1797c60751f551694def69afee6fbe295bbe2d2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
(cherry picked from qtbase/c012ee2940bc087720b4aa0d257540921cf9a139)
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
MinGW: Fix warnings about assigned but not used variables.

Change-Id: I114483273db0f9ffe0527b4a3e4cd881375a3448
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Fix MinGW-warnings about narrowing/invalid conversions.

Change-Id: I9b49dd6d12a5e59c6f2674ab3c82a8a7ec583775
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
qsimd: Fix compilation with MinGW 64.

Task-number: QTBUG-34856
Change-Id: Ie1dbeb5787e1a60aeaca585160319bbe0943e2cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Kernel: Fix gcc warning in qsharedmemory_win.cpp

Fix gcc 4.7 'arning: converting 'false' to pointer type 'HANDLE {aka void*}' [-Wconversion-null]'

Change-Id: I28d890d5fd4975517a9329d68c9ef73f6fadf36c
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
(cherry picked from qtbase/baf8a2fbf710314096832b0ee5735ffdc8b24210)