Ensure the native filedialog starts up with the right directory

On Mac it was not starting the dialog with the specified directory when
one was present. If a filename was given as well then it would start up
fine.

Task-number: QTBUG-28161
Change-Id: I7cce0d065dd57e6433ce62380d4263d6e20b6e7c
Reviewed-by: Liang Qi <liang.qi@digia.com>
(cherry picked from commit d75d86190bca85841db2040d50184f4c6886ef89)
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Add missing Objective-C namespace prefixes

Change-Id: I5d62fcf0880776e290ae739ece81b685bb7af194
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
qpa: Fix crash when requesting QApplication::platformNativeInterface()

If QApplication has not been instantiated, this function would
crash. Change it to return NULL pointer instead.

cherry-picked from qt5/qtbase 3ee48926e6584b4afeda1fc406d19d7b1a8d6f20
original patch from Miikka Heikkinen <miikka.heikkinen@digia.com>

Change-Id: Ic9aae241f9c424fb371ae1774da6a3cb28c31883
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@gmail.com>
Add a method that allows registration of files to types

There is currently no way in C++ to duplicate the functionality of a qmldir
file in mapping QML files to versioned types in a module. This functionality
would be useful both in cases where a separate qmldir file would be overkill,
and for cases where the type mapping should be generated dynamically.

Since public API is frozen for 4.8, this is being added as private API
for those who need some measure of compatibility with qtquick1 in Qt5.

Change-Id: I28d7898122c5556fcd7cf3476795bcf4bb288ea6
Manual cherry pick of qtquick1/9995a2910d8a5f0317fe3adeb54f838b99ab31a8
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QThread documentation: do not discourage the reimplementation of QThread

The new QThread documentation now really discourage to reimplement
QThread. But in fact, there are many cases where it is perfectly fine.
And the example given is even a case where using worker object is wrong.
The examle even contains a leak since the thread will never stop and
will even leak.

This changes put back some sentences from before commit
207f588b6896cbe72745037dc1cb0a3aef1cf6d0.

The sample code has been re-writen. Notice how reimpementing run takes
less lines of code, less runtime overhead, no leaks, and also is more
complete than the previous example.

This is a modified backport of
qtbase commit 91e12dca757a8ef5c4691b70eb80db61a9d47e83

Change-Id: I4932aef00307a6cf91d57d632a02b8a85e5e8845
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Fixed some issues in QFontconfigDatabase::fallbacksForFamily

In FcFontSort() the result parameter is not set in older fontconfig versions
(<=2.9.0), so this parameter is ignored. Some fontconfig objects are destroyed
after usage to avoid memory leaks. This is basically a backport from Qt5.

Change-Id: I557dbd5d7303cbd98becf169ebaa754e5d99c281
Reviewed-by: Wolfgang Bremer <wbremer@rim.com>
Reviewed-by: Jiang Jiang <gzjjgod@gmail.com>
 fix connman bearer for new API.

back ported from qt5 sha 2efccfeeef70ebd8a2db2ebccb3c63722ae76e1f

Change-Id: Ib9cdbb6e4bdfed8420cdc2364503445924c8c57c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
update ofono API

back ported from sha 539a024819a5f696b8afe899108b409f2b77549c

Change-Id: I3b4eac82c8d16076dc1987780512dcd93925e0b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix QDeclarativeListView currentSection property update

Model modifications that did not trigger the refill logic caused
the view's currentSection property to contain an outdated value.

A new autotest has been added to catch the bug.

Task-number: QTBUG-29712
Change-Id: I88cf1295ac55dad7596b6ba1fe475ebf98a31026
Reviewed-by: Alan Alpert <aalpert@rim.com>
(cherry picked from qtquick1/d31f965b72a1bb8aba0b846471780e90fcc895ba)
Clean whitespace

Change-Id: Iec1950a0f4053cd71633162f0cb50efc9d4d493f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(cherry picked from qtbase/64106705e7ca6132b1de15529c6206ebb0c58dfa)
QStackedLayout: Fix crash when focus widget is destroyed in hide()

We also have to make sure that when moving back to a page
that has a focusWidget(), the focus should go to the focusWidget()

Task-number: QTBUG-18242

Change-Id: Ibfa7d6361c1a456480b2f1584a88ef4c4f405709
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(cherry picked from qtbase/18f9eb797bffe8626f1edeca3c88f80dae0da8d7)