Commit Graph

14668 Commits

Author SHA1 Message Date
Gabriel de Dietrich
1e14762b8d Make QGuiApplication::exec() run within NSApplicationMain()
We follow the same pattern as for iOS and Windows ports, making
sure the user's main() runs in a platform friendly environment. In
this particular case, it means calling the user's main() during the
call of NSApplicationMain(), and calling the user's main() function
(renamed to qMain() as in Windows) after receiving
NSApplicationDidFinishLaunchingNotification. In practice, this means
that NSApp is running when qMain() is called, and therefore when
QCoreApplication::exec() is called.

For those command-line utilities running on QGuiApplication, or any
deriving class, and that do not provide a bundle, we override the main
bundle's dictionary and get NSApplicationMain() to run as usual.

Added cocoa/cocoamain "subdir" to build libqtcocoamain.a (together with
cocoa/cocoaplugin -- plugins/platforms/cocoa is made a subdirs project).
This library is linked against all GUI Qt apps and provides the actual
main() function. It also catches the launching NSApplication notifications,
and calls the user's qMain() function. Note that this will happen in the
same cases when the user's application will run with the Cocoa QPA plugin.

Launch related code in QCocoaApplicationDelegate is moved to libqtcocoamain,
QNSApplication is removed (but sendEvent: redirection still there), and
code in QCocoaEventDispatcher dealing with calling [NSApp run] and related
has been removed since it's become unreachable.

ChangeLog: [Qt for Mac] Make QGuiApplication::exec() run within NSApplicationMain()
Change-Id: I790e5138c29aac2e0215a9147d0148fece40ca22
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-08-29 12:44:07 +02:00
David Faure
ee9b9d9fd9 QFileDialog: add MIME Type filters
Currently just a convenience method for setNameFilters(), it uses
QMimeType to create a name filter from the glob patterns and
description defined in each MIME type.

In the longer term, this API could be used to do proper mimetype-based
filtering using QMimeDatabase::mimeTypeForFile() in the builtin
QFileDialog (aka "not native"), instead of only looking at globs via the
name filters.

Change-Id: I0edccf5f30c514481b47cd100d743d1ed7a24024
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-08-29 10:25:01 +02:00
David Faure
468b539935 Port uic to QCommandLineParser
Before:
=======
Qt User Interface Compiler version 5.2.0
Usage: uic [options] <uifile>

  -h, -help                 display this help and exit
  -v, -version              display version
  -d, -dependencies         display the dependencies
  -o <file>                 place the output into <file>
  -tr <func>                use func() for i18n
  -p, -no-protection        disable header protection
  -n, -no-implicit-includes disable generation of #include-directives
                            for forms generated by uic3
  -g <name>                 change generator

After:
======
Usage: uic [options] [uifile]
Qt User Interface Compiler version 5.2.0

Options:
  -h, --help                    Displays this help.
  -v, --version                 Displays version information.
  -d, --dependencies            Display the dependencies.
  -o, --output <file>           Place the output into <file>
  -p, --no-protection           Disable header protection.
  -n, --no-implicit-includes    Disable generation of #include-directives.
  --postfix <postfix>           Postfix to add to all generated classnames.
  --tr, --translate <function>  Use <function> for i18n.
  -g, --generator <java|cpp>    Select generator.

Arguments:
  [uifile]                      Input file (*.ui), otherwise stdin.

Notes:
* "-dependencies" etc. still work.
* -n option still has effect, but technically not only for ui3 files
* the fact that the <uifile> parameter is optional wasn't documented
* -postfix option was undocumented
* -translate alternative for -tr was undocumented
The last two points show the benefit of using QCommandLineParser.

Change-Id: Ie05cfb9bbe50f4ac2788aa7b6011b2daa1acde6a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-08-29 10:25:01 +02:00
David Faure
5eb91476f1 tst_qthreadpool: fix flaky test I introduced in last commit
(dacf9961da)
In order to see 2 active threads, we must check activeThreadCount() before
the runnable finishes.

Change-Id: I1a48b41e0c1fd81a65d915b9bd1e741ff267ed2b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-08-29 10:25:01 +02:00
David Faure
4774ff8eb1 Port rcc to QCommandLineParser.
Before:
=======
Qt resource compiler
Usage: rcc  [options] <inputs>

Options:
  -o file              write output to file rather than stdout
  -name name           create an external initialization function with name
  -threshold level     threshold to consider compressing files
  -compress level      compress input files by level
  -root path           prefix resource access path with root path
  -no-compress         disable all compression
  -binary              output a binary file for use as a dynamic resource
  -namespace           turn off namespace macros
  -project             Output a resource file containing all
                       files from the current directory
  -version             display version
  -help                display this information

Undocumented: -verbose and -list !

After:
======
Usage: rcc [options] inputs
Qt Resource Compiler version 5.2.0

Options:
  -h, --help          Displays this help.
  -v, --version       Displays version information.
  -o, --output <file> Write output to <file> rather than stdout.
  --name <name>       Create an external initialization function with <name>.
  --root <path>       Prefix resource access path with root path.
  --compress <level>  Compress input files by <level>.
  --no-compress       Disable all compression.
  --threshold <level> Threshold to consider compressing files.
  --binary            Output a binary file for use as a dynamic resource.
  --namespace         Turn off namespace macros.
  --verbose           Enable verbose mode.
  --list              Only list the files, do not generate code.
  --project           Output a resource file containing all files from the current directory.

Arguments:
  inputs              Input files (*.qrc).

Change-Id: If20958afd6c01df5d0d755e13e8581bc1cb9af51
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-29 10:25:01 +02:00
Thorbjørn Martsum
6ee9baf044 QLinkedList - extend the auto test.
This extends the QLinkedList auto test. This is copy paste
with small edits from the QList auto test.

Change-Id: I5bce7ee304998d1c7258f11b2f31a7fb87706936
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-29 08:16:44 +02:00
John Layt
ad77048d1f QDateTime - Extend fromMSecsSinceEpoch API
Add convenience methods for fromMSecsSinceEpoch() and
fromTime_t() to enable direct creation of other time specs
than LocalTime without the overhead of unncessary conversions.

For example instead of:
  QDateTime dt = fromMSecsSinceEpoch(12345).toUtc();
the following saves two conversions:
  QDateTime dt = fromMSecsSinceEpoch(12345, Qt:UTC);

This will improve the performance of the new QTimeZone class.

[ChangeLog][QtCore][QDateTime] Added convenience methods for
fromMSecsSinceEpoch() and fromTime_t() to take time spec to be used in
returned datetime.

Change-Id: I133635bfe3d35ee496a287257e13b2d600225a38
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-08-29 00:32:08 +02:00
John Layt
13c16bbd06 QDateTime - Improve and expose Qt::OffsetFromUtc
The Qt::OffsetFromUtc TimeSpec was made public in Qt 4.4 but the access
methods were never made public in the apidox effectively meaning the
feature was never used.  The implementation was also incomplete and
inconsistent.

This change cleans up the implementation and exports new public API for
using the TimeSpec using new method names consistent with the new
QTimeZone support.

This change increases the QDataStream Version number for Qt 5.2 to 15.

The behavior of one constructor has changed slightly to be consistent
with the rest of the feature, but this behavior was never documented.

[ChangeLog][QtCore][QDateTime] Fully implement support for Qt::TimeSpec
of Qt::OffsetFromUTC, added new methods for offsetFromUTC(),
toTimeSpec(), and toOffsetFromUTC().

Task-number: QTBUG-26161
Task-number: QTBUG-29666

Change-Id: If3cc7fc9778ca2b831644408ae749448d5975a3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-08-28 19:08:14 +02:00
Robin Burchell
80cb575953 Remove Maliit input context.
Maliit upstream has its own IC which is more advanced than this one, as well as
being supported.

Change-Id: I4b820fc7f39468e53c113699c4c43c75d490f65b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
2013-08-28 17:01:40 +02:00
Yoann Lopes
e94c221655 Android: added ApplicationState capability.
The application state is tied to the QtActivity lifecycle.
Mapping of states between Android and Qt is as follows:
 onResume --> ApplicationActive
 onPause  --> ApplicationInactive
 onStop   --> ApplicationSuspended

Change-Id: Iefef08d6c7a7fde28fba1f4886882458cda6a0c0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-08-28 17:00:15 +02:00
Thorbjørn Martsum
fd871694e7 QButtonGroup - add buttonToggled signals
QButtonGroup emits signals on clicked, pressed and released for
buttons in the group, but for some (insuffienct) reason it did
not emit anything for toggle (the only signal that it didn't emit
anything for).

This patch changes that, by adding handling of that signal to
QButtonGroup.

Task-number: QTBUG-14857

Change-Id: I88bcd7b060b78c7ff05ea1adf7baaddfe6d463be
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-08-28 12:15:43 +02:00
Jerome Pasion
ea94afca56 Doc: Changed CSS text-align from "justify" to "left".
-Documentation looks weird when viewed in a narrow window because
 much of the text are long.
-Qt Project's CSS uses "left".
-This change affects any documentation which uses the global
 templates.

Change-Id: I8605a191904cb727b4818d8a1abf127ce2e45eb9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-08-28 12:15:43 +02:00
David Faure
e8e7128188 Add QCommandLineParser to the bootstrap lib
Change-Id: I861758746eca954cf074893b0241fd66c2ff39d2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-08-28 12:15:43 +02:00
Giuseppe D'Angelo
a79e42b8f4 Enable DWM transparency for OpenGL windows under Windows
Starting with Windows Vista, we can control the compositing window
manager using the DWM APIs. This allows us to make truly transparent
OpenGL windows.

We also have to detect and listen if compositing is enabled, otherwise
enabling transparency will cause glitches all over the place.

This (partially) fixes
Task-number: QTBUG-28214

Change-Id: I0fe1ec7adec8181b788c32de03c59142731d9e7f
Done-with: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-08-28 09:33:46 +02:00
Wolfgang Bremer
9de144f4b1 Revert "Add the same flags for the c++ compiler as they are already defined for the c compiler"
The previous commit was unnecessary.
The value of QMAKE_CFLAGS is used for QMAKE_CXXFLAGS as well.
This is done in qcc-base.conf, which is included via
blackberry-armv7le.conf -> qcc-base-qnx-armv7le.conf -> qcc-base-qnx.conf -> qcc-base.conf
Currently, the BlackBerry arm compiler calls show duplicate entries.

This reverts commit 539f90e971.

Change-Id: I6e055ce9aafd16e91e15817946b7561bd76ee43e
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
2013-08-28 01:57:25 +02:00
Stephen Kelly
db87c9ead2 Don't compare const_iterator with iterator.
Commit 93ffb81df6 introduced this bug. As
it is in the header, it affects downstreams.

Change-Id: I02e86927e648153ca7c0b66ac945a7f99cc4cd89
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-27 22:32:35 +02:00
Paul Olav Tvete
f3c019649b Test layout engine fundamentals
Done with Jan Arve

Task-number: QTBUG-33104

Change-Id: I8319748536d448d1c37a26527ced53156d8c2f56
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-08-27 22:00:48 +02:00
Konstantin Ritt
3aa163491c Add configure options for [experimental] HarfBuzz-NG support
Change-Id: I15f49b56f49ae53c16db904e03f668c3135edaa5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-27 18:05:08 +02:00
Konstantin Ritt
c88f1492c6 Fix help output for freetype and PCRE in windows configure app
Change-Id: I686a63a02a5544736c84bcdbe274275acabfbc3d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-27 18:05:03 +02:00
Konstantin Ritt
9e0cccde0a Refactor line breaks in windows configure app
As a side effect, this fixes wrong line break in "Third Party Libraries" section.

Change-Id: Ie6510fa94626a1c586621948a4681efdcf61f8b2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-27 18:05:00 +02:00
Konstantin Ritt
370ea08f77 Add freetype result info to unix configure output
Change-Id: I0393a593a721ec0cd7e7a2490e0fe0453f092934
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-27 18:04:55 +02:00
Konstantin Ritt
9ece604d9b Add stripped version of HarfBuzz-NG 0.9.19 sources to 3rdparty
Change-Id: I06fbf58131ebce51ce95921d8dfd65dd3d3e236f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-27 18:04:28 +02:00
Konstantin Ritt
79e77a58a6 Make it possible to build HarfBuzz-NG in Qt
Change-Id: Ib956adb0ab7bcfba3ce73acf7c19bda815d6eb73
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-27 18:04:23 +02:00
Sean Harmer
a70c0ad1d1 Add operator[] to QVectorND classes
Change-Id: Ia786d4fab64da974bb60f24c05325925d42a1e70
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2013-08-27 17:50:40 +02:00
Oswald Buddenhagen
e0f2603f49 avoid deadlock in cache() during spec/cache loading
sync up; this doesn't actually do anything in qmake.

if we end up calling cache() from within the initialization of the base
context, we cannot wait for for the completion of that initialization
before we proceed, obviously.

Change-Id: If30c6f3665fe423e767373a8821c406b2f5e0eca
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
(cherry picked from qtcreator/b64b4431c20afd9e39c1463e736f998ef450688f)
2013-08-27 13:36:34 +02:00
Oswald Buddenhagen
652bdb8894 lock baseEnv in cache()
sync up; this doesn't actually do anything in qmake.

as we modify the environment, it must be properly locked.
this implies that initFrom() also needs to be called with a lock.

Task-number: QTCREATORBUG-9835
Change-Id: I48bae9af9adaa0518e5a9db0ba08ff057ae14f9f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtcreator/d022a2d19cecb00397c2a215fc4e3bf64b1e627b)
2013-08-27 13:36:31 +02:00
Oswald Buddenhagen
957134dc84 always check for baseEnv init failure
sync up; this doesn't actually do anything in qmake.

creator's file watcher can trigger many parallel, entirely
non-hierarchical project reloads. if there is enough of them to exceed
the thread pool size, some will be serialized already by qtconcurrent,
not by our wait condition. these should notice a faulty spec, too.

Change-Id: I8ce40cb90fbc28045127881d57ec94e125df79af
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtcreator/759d0a69dd3973b4785b6f9412f46666a05cdf85)
2013-08-27 13:36:28 +02:00
Mitch Curtis
507f1889e2 Add QJsonValue::toInt().
It's a nice feature to have.

MSVC also complains about using doubles to create enum values, so
the ugly workaround is:

enumValue = MyEnum(qRound(json["myEnumValue"].toDouble()));

[ChangeLog][QtCore][QJsonValue]Added QJsonValue::toInt().

Change-Id: I1a200b912abf66b2e96390b1980caff26cfa2685
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-08-27 08:01:29 +02:00
Thorbjørn Martsum
f73518e732 QMessageBox - move informative+details text to new layout function
Controlling the layout from different functions is not easy, so
lets move it to the setupLayout function.

Change-Id: I3120a2e98b2f8425befa135595d4ad7ce1b8ca56
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-08-27 05:56:09 +02:00
Thiago Macieira
77e8ff66f0 Move the creation of QElapsedTimer out of the inner function in QMutex
Makes it possible for QElapsedTimer to be non-POD.

Change-Id: I5ffc59c7a93c187a4a814e6959f8383fa8d4cc44
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-08-27 03:51:31 +02:00
Thiago Macieira
a7ba0ad93e Make sure deprecation warnings don't cause errors with -Werror
It sounds like a good thing to have this warning, but for
future-proofing we can't have it. The system libraries might change
and add deprecation marks (OS X does that often). If they do that, we
don't want poor developers to have to fix all warnings before they can
build Qt again.

Change-Id: I4ff317da0de596c470bb1efe6e59bcf70aeec8fc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-08-27 03:50:58 +02:00
Thiago Macieira
b0b5ade8d3 Don't try to detect the CPUID instruction if we're compiling for Pentium
If we're compiling for Pentium or better CPUs, then we know that the
CPUID instruction is present (I think it was introduced in late 486s,
actually). So don't try to detect it. Simply assume it's there and then
execute it.

This means that if you compile Qt for Pentium (or higher) and run it on
an i386 or i486, you'll get a SIGILL (or whatever your OS produces for
an #UD processor exception). If the CPU detection code even got run --
SIGILL might happen for any other instructions found along the way.

Change-Id: Iacd4a94a51363a609a61fc2bfd2e218fb290272d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-27 03:50:50 +02:00
Joerg Bornemann
788bde071a remove support for Qtopia's QOM_OBJECT macro
That's not been in use for quite a while.

Change-Id: If5a18a54d32f330fe37655516d4b83e5d3d30afc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-08-26 12:21:40 +02:00
Thorbjørn Lund Martsum
934f062203 QAIV - Fix scollbars with ScrollPerPixel to scroll 1 pixel.
The documentation says that we scroll one pixel

Quote:
"QAbstractItemView::ScrollPerPixel  (value 1)"
"The view will scroll the contents one pixel at a time."

However until now Qt has tried to be smarter than the
documentation, but is actually getting in the way of the user,
where a manual set value to setSingleStep will continuingly
be overwritten (on e.g resize).

This patch ensures the behavior described in the documentation
for the vertical headers - and leaves the control to the user.

[ChangeLog][QtWidgets][QAbstractItemView]  QTBUG-7232 - In ItemViews
scrollbars will now by default only scroll 1 pixel when scrollMode
is set to scrollPerPixel. That is it will (when scrollMode is
scrollPerPixel) do what is stated in the documentation, and no
longer automatically adjust the scrollbars singleStep. The user
can now control that value.

Task-number: QTBUG-7232

Change-Id: I8a61d3100be65d0c4ee32aad58caed019aa2669c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-08-26 09:40:59 +02:00
Martin Smith
94dca6d10c qdoc: Fixed the relative link to installdir problem
Instead of using the fake "outputdir" to force qdoc
to generate a relative path to the actual output dir,
it now uses the value of HTML.outputsubdir, or just
"html" if HTML.outputsubdir is not specified.

Task-number: QTBUG-32580
Change-Id: I45c79a788e102213e6d343a7ed108a3d17d94759
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-08-26 08:53:32 +02:00
David Faure
404598b613 Long live QCommandLineParser!
The QCommandLineParser class provides a means for handling the command line options.

QCoreApplication provides the command-line arguments as a simple list of strings.
QCommandLineParser provides the ability to define a set of options, parse the
command-line arguments, and store which options have actually been used, as
well as option values.

Done-with: Laszlo Papp <lpapp@kde.org>

Change-Id: Ic7bebc10b3f8d8dd06ad0f4bb897c51d566e3b7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-08-24 21:33:39 +02:00
Thiago Macieira
1411a6f1ac 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>
2013-08-24 17:41:38 +02:00
Thorbjørn Martsum
c35b55f076 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>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
97f867212f 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>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
ea25495703 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>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
5fc13cc06a 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>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
a5c7a9032e 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>
2013-08-24 15:36:30 +02:00
Thorbjørn Martsum
93ffb81df6 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>
2013-08-24 15:36:30 +02:00
David Faure
dacf9961da 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>
2013-08-24 13:09:46 +02:00
Thiago Macieira
7c2a418857 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>
2013-08-23 21:39:23 +02:00
Thiago Macieira
043b809197 Set an upper range of compiler versions for -Werror
This allows us to go back to older versions of Qt with newer compilers,
that didn't exist when those versions were released. It also allows
someone upgrading their compiler and not being faced with having to fix
all warnings before Qt compiles.

This commit whitelists the following compilers:
* Apple Clang versions 4.0, 4.1 and 4.2 (OS X only)
* Intel Compiler versions 13.0, 13.1 and 14.0 (Linux only)
* GCC versions 4.6, 4.7 and 4.8 (all OS)

Notably, Clang on other other OS besides OS X and MSVC are missing.

Change-Id: I665160d40a59336da1904f2a6c1eda543e592b48
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-08-23 18:56:09 +02:00
Christian Kandeler
5774f3c944 Fix name of configure flag in QSettings documentation.
It's "-sysconfdir", with one hyphen.

Change-Id: I62ddece98ee23989ae8d1881feb375e30d872190
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-08-23 14:23:42 +02:00
Tor Arne Vestbø
56083adbea iOS: Make the event dispatcher properly emit aboutToBlock() and awake()
This approach follows the same one used by the Cocoa event dispatcher.

Change-Id: I2813b09beae07d90477c9ca506924058ace13f34
Reviewed-by: Ian Dean <ian@mediator-software.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-08-23 11:28:48 +02:00
Tor Arne Vestbø
321cc1f277 Share named time-interval constants in CoreFoundation event dispatcher
Change-Id: Ie9ae40e3f7e2631c461ad01b6e5a4640c0b773c9
Reviewed-by: Ian Dean <ian@mediator-software.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-08-23 11:28:48 +02:00
Tor Arne Vestbø
c0e5f31ad8 iOS: Wrap CFRunLoopSource in C++ class for easier code legibility
Change-Id: If34953b171676f0246c2fb5e60c59f59350863ec
Reviewed-by: Ian Dean <ian@mediator-software.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-08-23 11:28:48 +02:00