summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/libpng.pri17
-rw-r--r--src/3rdparty/libpng/png.c3
-rw-r--r--src/3rdparty/libpng/png.h11
-rw-r--r--src/3rdparty/libpng/pngconf.h3
-rw-r--r--src/3rdparty/libpng/pngdebug.h6
-rw-r--r--src/3rdparty/libpng/pngerror.c4
-rw-r--r--src/3rdparty/libpng/pngget.c3
-rw-r--r--src/3rdparty/libpng/pnginfo.h3
-rw-r--r--src/3rdparty/libpng/pngmem.c3
-rw-r--r--src/3rdparty/libpng/pngpread.c3
-rw-r--r--src/3rdparty/libpng/pngpriv.h19
-rw-r--r--src/3rdparty/libpng/pngread.c3
-rw-r--r--src/3rdparty/libpng/pngrio.c2
-rw-r--r--src/3rdparty/libpng/pngrtran.c3
-rw-r--r--src/3rdparty/libpng/pngrutil.c6
-rw-r--r--src/3rdparty/libpng/pngset.c3
-rw-r--r--src/3rdparty/libpng/pngstruct.h2
-rw-r--r--src/3rdparty/libpng/pngtest.c7
-rw-r--r--src/3rdparty/libpng/pngtrans.c3
-rw-r--r--src/3rdparty/libpng/pngwio.c3
-rw-r--r--src/3rdparty/libpng/pngwrite.c3
-rw-r--r--src/3rdparty/libpng/pngwtran.c3
-rw-r--r--src/3rdparty/libpng/pngwutil.c3
-rw-r--r--src/3rdparty/libpng/privatepng.cpp16
-rw-r--r--src/3rdparty/webkit/Source/JavaScriptCore/jit/JITStubs.cpp8
-rw-r--r--src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/common/debug.h8
-rw-r--r--src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp2
-rw-r--r--src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp4
-rw-r--r--src/3rdparty/webkit/Source/WebCore/platform/sql/SQLiteFileSystem.cpp4
-rw-r--r--src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro2
-rw-r--r--src/corelib/arch/qatomic_integrity.h7
-rw-r--r--src/corelib/global/qglobal.cpp13
-rw-r--r--src/corelib/global/qglobal.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp27
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian_p.h4
-rw-r--r--src/corelib/kernel/qobjectdefs.h2
-rw-r--r--src/corelib/kernel/qtranslator.cpp18
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
-rw-r--r--src/corelib/plugin/qplugin.h8
-rw-r--r--src/corelib/tools/qlocale_tools.cpp7
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp15
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp102
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp4
-rw-r--r--src/declarative/qml/qpodvector_p.h4
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp57
-rw-r--r--src/gui/dialogs/qfiledialog.cpp2
-rw-r--r--src/gui/embedded/qscreenintegrityfb_qws.cpp154
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp5
-rw-r--r--src/gui/image/qimagereader.cpp5
-rw-r--r--src/gui/image/qpnghandler.cpp1
-rw-r--r--src/gui/image/qtiffhandler.cpp6
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp193
-rw-r--r--src/gui/kernel/qapplication_s60.cpp96
-rw-r--r--src/gui/kernel/qclipboard_s60.cpp3
-rw-r--r--src/gui/kernel/qwidget_x11.cpp28
-rw-r--r--src/gui/painting/painting.pri6
-rw-r--r--src/gui/painting/qbackingstore.cpp2
-rw-r--r--src/gui/painting/qgraphicssystemex_symbian.cpp2
-rw-r--r--src/gui/painting/qgraphicssystemhelper_symbian.cpp141
-rw-r--r--src/gui/painting/qgraphicssystemhelper_symbian.h82
-rw-r--r--src/gui/styles/qmacstyle_mac.mm101
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp1
-rw-r--r--src/imports/shaders/shadereffect.cpp4
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp1
-rw-r--r--src/network/kernel/qnetworkproxy.cpp6
-rw-r--r--src/network/kernel/qnetworkproxy_generic.cpp31
-rw-r--r--src/network/socket/qlocalserver_unix.cpp8
-rw-r--r--src/network/ssl/qssl.cpp8
-rw-r--r--src/network/ssl/qssl.h3
-rw-r--r--src/network/ssl/qsslconfiguration.cpp2
-rw-r--r--src/network/ssl/qsslconfiguration_p.h3
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp8
-rw-r--r--src/opengl/qgl_qpa.cpp2
-rw-r--r--src/opengl/qwindowsurface_gl.cpp2
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp2
-rw-r--r--src/plugins/imageformats/imageformats.pro1
-rw-r--r--src/plugins/imageformats/tga/main.cpp95
-rw-r--r--src/plugins/imageformats/tga/qtgafile.cpp266
-rw-r--r--src/plugins/imageformats/tga/qtgafile.h157
-rw-r--r--src/plugins/imageformats/tga/qtgahandler.cpp122
-rw-r--r--src/plugins/imageformats/tga/qtgahandler.h74
-rw-r--r--src/plugins/imageformats/tga/tga.pro16
-rw-r--r--src/plugins/inputmethods/imsw-multi/qmultiinputcontext.cpp2
-rw-r--r--src/plugins/inputmethods/imsw-multi/qmultiinputcontext.h2
-rw-r--r--src/plugins/platforms/openkode/qopenkodewindow.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp2
-rw-r--r--src/src.pro2
-rw-r--r--src/testlib/3rdparty/valgrind_p.h4
-rw-r--r--src/testlib/qxmltestlogger.cpp4
-rw-r--r--src/xml/dom/qdom.cpp6
93 files changed, 1645 insertions, 460 deletions
diff --git a/src/3rdparty/libpng.pri b/src/3rdparty/libpng.pri
index 7ac1910..81966cb 100644
--- a/src/3rdparty/libpng.pri
+++ b/src/3rdparty/libpng.pri
@@ -1,20 +1,7 @@
DEFINES *= QT_USE_BUNDLED_LIBPNG
!isEqual(QT_ARCH, i386):!isEqual(QT_ARCH, x86_64):DEFINES += PNG_NO_ASSEMBLER_CODE
INCLUDEPATH += $$PWD/libpng
-SOURCES += $$PWD/libpng/png.c \
- $$PWD/libpng/pngerror.c \
- $$PWD/libpng/pngget.c \
- $$PWD/libpng/pngmem.c \
- $$PWD/libpng/pngpread.c \
- $$PWD/libpng/pngread.c \
- $$PWD/libpng/pngrio.c \
- $$PWD/libpng/pngrtran.c \
- $$PWD/libpng/pngrutil.c \
- $$PWD/libpng/pngset.c \
- $$PWD/libpng/pngtrans.c \
- $$PWD/libpng/pngwio.c \
- $$PWD/libpng/pngwrite.c \
- $$PWD/libpng/pngwtran.c \
- $$PWD/libpng/pngwutil.c
+
+SOURCES += $$PWD/libpng/privatepng.cpp
include($$PWD/zlib_dependency.pri)
diff --git a/src/3rdparty/libpng/png.c b/src/3rdparty/libpng/png.c
index eed3136..db37732 100644
--- a/src/3rdparty/libpng/png.c
+++ b/src/3rdparty/libpng/png.c
@@ -13,6 +13,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_5_4 Your_png_h_is_not_version_1_5_4;
@@ -2420,3 +2422,4 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
}
#endif /* READ_GAMMA */
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/png.h b/src/3rdparty/libpng/png.h
index c655a51..69d9538 100644
--- a/src/3rdparty/libpng/png.h
+++ b/src/3rdparty/libpng/png.h
@@ -464,11 +464,6 @@
#ifndef PNG_VERSION_INFO_ONLY
-/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
/* Version information for C files, stored in png.c. This had better match
* the version above.
*/
@@ -520,6 +515,7 @@ extern "C" {
* See pngconf.h for base types that vary by machine/system
*/
+namespace PrivatePng {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
@@ -2579,10 +2575,7 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
PNG_EXPORT_LAST_ORDINAL(229);
#endif
-#ifdef __cplusplus
-}
-#endif
-
#endif /* PNG_VERSION_INFO_ONLY */
/* Do not put anything past this line */
+} // namespace PrivatePng
#endif /* PNG_H */
diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h
index b02f2a0..754f91f 100644
--- a/src/3rdparty/libpng/pngconf.h
+++ b/src/3rdparty/libpng/pngconf.h
@@ -64,6 +64,7 @@
# endif
#endif
+namespace PrivatePng {
/* COMPILER SPECIFIC OPTIONS.
*
* These options are provided so that a variety of difficult compilers
@@ -627,5 +628,5 @@ typedef char FAR * FAR * FAR * png_charppp;
# endif
# endif
#endif
-
+} // namespace PrivatePng
#endif /* PNGCONF_H */
diff --git a/src/3rdparty/libpng/pngdebug.h b/src/3rdparty/libpng/pngdebug.h
index 16f81fd..4547b7d 100644
--- a/src/3rdparty/libpng/pngdebug.h
+++ b/src/3rdparty/libpng/pngdebug.h
@@ -85,7 +85,7 @@
# define png_debug(l,m) \
do { \
int num_tabs=l; \
- fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
+ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
} while (0)
# endif
@@ -93,7 +93,7 @@
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
- fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
+ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
} while (0)
# endif
@@ -101,7 +101,7 @@
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
- fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
+ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
} while (0)
# endif
diff --git a/src/3rdparty/libpng/pngerror.c b/src/3rdparty/libpng/pngerror.c
index 4d4ceba..5559cfb 100644
--- a/src/3rdparty/libpng/pngerror.c
+++ b/src/3rdparty/libpng/pngerror.c
@@ -18,6 +18,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
static PNG_FUNCTION(void, png_default_error,PNGARG((png_structp png_ptr,
@@ -670,3 +672,5 @@ png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode)
}
#endif
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
+} // namespace PrivatePng
+
diff --git a/src/3rdparty/libpng/pngget.c b/src/3rdparty/libpng/pngget.c
index b5e5798..0f18370 100644
--- a/src/3rdparty/libpng/pngget.c
+++ b/src/3rdparty/libpng/pngget.c
@@ -14,6 +14,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
png_uint_32 PNGAPI
@@ -1030,3 +1032,4 @@ png_get_io_chunk_name (png_structp png_ptr)
#endif /* ?PNG_IO_STATE_SUPPORTED */
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pnginfo.h b/src/3rdparty/libpng/pnginfo.h
index a33bfab..2ce4350 100644
--- a/src/3rdparty/libpng/pnginfo.h
+++ b/src/3rdparty/libpng/pnginfo.h
@@ -53,6 +53,7 @@
#ifndef PNGINFO_H
#define PNGINFO_H
+namespace PrivatePng {
struct png_info_def
{
/* the following are necessary for every PNG file */
@@ -266,4 +267,6 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
#endif
};
+
+} // namespace PrivatePng
#endif /* PNGINFO_H */
diff --git a/src/3rdparty/libpng/pngmem.c b/src/3rdparty/libpng/pngmem.c
index ea606d6..9f2e4df 100644
--- a/src/3rdparty/libpng/pngmem.c
+++ b/src/3rdparty/libpng/pngmem.c
@@ -19,6 +19,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
/* Borland DOS special memory handler */
@@ -665,3 +667,4 @@ png_get_mem_ptr(png_const_structp png_ptr)
}
#endif /* PNG_USER_MEM_SUPPORTED */
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
+} // PrivatePng namespace
diff --git a/src/3rdparty/libpng/pngpread.c b/src/3rdparty/libpng/pngpread.c
index a50292a..26eb777 100644
--- a/src/3rdparty/libpng/pngpread.c
+++ b/src/3rdparty/libpng/pngpread.c
@@ -13,6 +13,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
/* Push model modes */
@@ -1854,3 +1856,4 @@ png_get_progressive_ptr(png_const_structp png_ptr)
return png_ptr->io_ptr;
}
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngpriv.h b/src/3rdparty/libpng/pngpriv.h
index ca2fb8c..be4146d 100644
--- a/src/3rdparty/libpng/pngpriv.h
+++ b/src/3rdparty/libpng/pngpriv.h
@@ -46,6 +46,7 @@
/* This is required for the definition of abort(), used as a last ditch
* error handler when all else fails.
*/
+
#include <stdlib.h>
#define PNGLIB_BUILD
@@ -63,10 +64,12 @@
#include "pnginfo.h"
#include "pngstruct.h"
+namespace PrivatePng {
/* This is used for 16 bit gamma tables - only the top level pointers are const,
* this could be changed:
*/
typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
+} // namespace PrivatePng
/* Added at libpng-1.2.9 */
/* Moved to pngpriv.h at libpng-1.5.0 */
@@ -429,6 +432,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
* NOTE: by default this is off - the macro is not used - because the
* function call saves a lot of code.
*/
+namespace PrivatePng {
#ifdef PNG_FIXED_POINT_MACRO_SUPPORTED
#define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\
((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0))
@@ -437,6 +441,7 @@ PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp,
png_const_charp text));
#endif
#endif
+} // namespace PrivatePng
/* Constant strings for known chunk types. If you need to add a chunk,
* define the name here, and add an invocation of the macro wherever it's
@@ -470,18 +475,14 @@ PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp,
#define PNG_GAMMA_MAC_INVERSE 65909
#define PNG_GAMMA_sRGB_INVERSE 45455
-
-/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
/* These functions are used internally in the code. They generally
* shouldn't be used unless you are writing code to add or replace some
* functionality in libpng. More information about most functions can
* be found in the files where the functions are located.
*/
+namespace PrivatePng {
+
/* Check the user version string for compatibility, returns false if the version
* numbers aren't compatible.
*/
@@ -1355,10 +1356,8 @@ PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr,
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
-#include "pngdebug.h"
+} // PrivatePng
-#ifdef __cplusplus
-}
-#endif
+#include "pngdebug.h"
#endif /* PNGPRIV_H */
diff --git a/src/3rdparty/libpng/pngread.c b/src/3rdparty/libpng/pngread.c
index be3df47..662dd4a 100644
--- a/src/3rdparty/libpng/pngread.c
+++ b/src/3rdparty/libpng/pngread.c
@@ -16,6 +16,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#ifdef PNG_READ_SUPPORTED
/* Create a PNG structure for reading, and allocate any memory needed. */
@@ -1452,3 +1454,4 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
#endif /* PNG_INFO_IMAGE_SUPPORTED */
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
#endif /* PNG_READ_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngrio.c b/src/3rdparty/libpng/pngrio.c
index e9c381c..3a6e536 100644
--- a/src/3rdparty/libpng/pngrio.c
+++ b/src/3rdparty/libpng/pngrio.c
@@ -20,6 +20,7 @@
#include "pngpriv.h"
+namespace PrivatePng {
#ifdef PNG_READ_SUPPORTED
/* Read the data from whatever input you are using. The default routine
@@ -174,3 +175,4 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
#endif
}
#endif /* PNG_READ_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngrtran.c b/src/3rdparty/libpng/pngrtran.c
index 4e0401a..d5b9d45 100644
--- a/src/3rdparty/libpng/pngrtran.c
+++ b/src/3rdparty/libpng/pngrtran.c
@@ -18,6 +18,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#ifdef PNG_READ_SUPPORTED
/* Set the action on getting a CRC error for an ancillary or critical chunk. */
@@ -4951,3 +4953,4 @@ png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
}
#endif /* PNG_MNG_FEATURES_SUPPORTED */
#endif /* PNG_READ_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngrutil.c b/src/3rdparty/libpng/pngrutil.c
index daf3c5e..9b0ff3e 100644
--- a/src/3rdparty/libpng/pngrutil.c
+++ b/src/3rdparty/libpng/pngrutil.c
@@ -16,6 +16,7 @@
#include "pngpriv.h"
+namespace PrivatePng {
#ifdef PNG_READ_SUPPORTED
#define png_strtod(p,a,b) strtod(a,b)
@@ -458,7 +459,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
{
/* Success (maybe) - really uncompress the chunk. */
png_size_t new_size = 0;
- png_charp text = png_malloc_warn(png_ptr,
+ png_charp text = (png_charp) png_malloc_warn(png_ptr,
prefix_size + expanded_size + 1);
if (text != NULL)
@@ -501,7 +502,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
* amount of compressed data.
*/
{
- png_charp text = png_malloc_warn(png_ptr, prefix_size + 1);
+ png_charp text = (png_charp) png_malloc_warn(png_ptr, prefix_size + 1);
if (text != NULL)
{
@@ -3666,3 +3667,4 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
png_ptr->flags |= PNG_FLAG_ROW_INIT;
}
#endif /* PNG_READ_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngset.c b/src/3rdparty/libpng/pngset.c
index 7eaad7d..bb7c1ab 100644
--- a/src/3rdparty/libpng/pngset.c
+++ b/src/3rdparty/libpng/pngset.c
@@ -18,6 +18,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
#ifdef PNG_bKGD_SUPPORTED
@@ -1224,3 +1226,4 @@ png_set_benign_errors(png_structp png_ptr, int allowed)
}
#endif /* PNG_BENIGN_ERRORS_SUPPORTED */
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngstruct.h b/src/3rdparty/libpng/pngstruct.h
index 93b2b3e..d984461 100644
--- a/src/3rdparty/libpng/pngstruct.h
+++ b/src/3rdparty/libpng/pngstruct.h
@@ -26,6 +26,7 @@
*/
#include "zlib.h"
+namespace PrivatePng {
struct png_struct_def
{
#ifdef PNG_SETJMP_SUPPORTED
@@ -334,4 +335,5 @@ struct png_struct_def
png_uint_32 io_state;
#endif
};
+} // namespace PrivatePng
#endif /* PNGSTRUCT_H */
diff --git a/src/3rdparty/libpng/pngtest.c b/src/3rdparty/libpng/pngtest.c
index 9084ada..1a9f8db 100644
--- a/src/3rdparty/libpng/pngtest.c
+++ b/src/3rdparty/libpng/pngtest.c
@@ -32,13 +32,13 @@
*/
#define _POSIX_SOURCE 1
-
#include "zlib.h"
#include "png.h"
/* Copied from pngpriv.h but only used in error messages below. */
#ifndef PNG_ZBUF_SIZE
# define PNG_ZBUF_SIZE 8192
#endif
+
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -99,8 +99,9 @@ static char tIME_string[PNG_tIME_STRING_LENGTH] = "tIME chunk is not present";
static int verbose = 0;
+namespace PrivatePng {
int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname));
-
+}
#ifdef __TURBOC__
#include <mem.h>
#endif
@@ -114,6 +115,7 @@ int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname));
# define png_jmpbuf(png_ptr) png_ptr->jmpbuf
#endif
+namespace PrivatePng {
/* Example of using row callbacks to make a simple progress meter */
static int status_pass = 1;
static int status_dots_requested = 0;
@@ -1795,3 +1797,4 @@ main(int argc, char *argv[])
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_5_4 Your_png_h_is_not_version_1_5_4;
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngtrans.c b/src/3rdparty/libpng/pngtrans.c
index 6a6908d..2e84686 100644
--- a/src/3rdparty/libpng/pngtrans.c
+++ b/src/3rdparty/libpng/pngtrans.c
@@ -13,6 +13,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
@@ -676,3 +678,4 @@ png_get_current_pass_number(png_const_structp png_ptr)
#endif /* PNG_READ_USER_TRANSFORM_SUPPORTED ||
PNG_WRITE_USER_TRANSFORM_SUPPORTED */
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngwio.c b/src/3rdparty/libpng/pngwio.c
index 95ffb34..3dc7378 100644
--- a/src/3rdparty/libpng/pngwio.c
+++ b/src/3rdparty/libpng/pngwio.c
@@ -20,6 +20,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#ifdef PNG_WRITE_SUPPORTED
/* Write the data to whatever output you are using. The default routine
@@ -252,3 +254,4 @@ void *png_far_to_near(png_structp png_ptr, png_voidp ptr, int check)
# endif
#endif
#endif /* PNG_WRITE_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngwrite.c b/src/3rdparty/libpng/pngwrite.c
index d1af9e8..a945eb8 100644
--- a/src/3rdparty/libpng/pngwrite.c
+++ b/src/3rdparty/libpng/pngwrite.c
@@ -13,6 +13,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#ifdef PNG_WRITE_SUPPORTED
/* Writes all the PNG information. This is the suggested way to use the
@@ -1653,3 +1655,4 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
}
#endif
#endif /* PNG_WRITE_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngwtran.c b/src/3rdparty/libpng/pngwtran.c
index 124d708..1b36d01 100644
--- a/src/3rdparty/libpng/pngwtran.c
+++ b/src/3rdparty/libpng/pngwtran.c
@@ -13,6 +13,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#ifdef PNG_WRITE_SUPPORTED
#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
@@ -631,3 +633,4 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
}
#endif /* PNG_MNG_FEATURES_SUPPORTED */
#endif /* PNG_WRITE_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/pngwutil.c b/src/3rdparty/libpng/pngwutil.c
index 3ae5ed4..1082350 100644
--- a/src/3rdparty/libpng/pngwutil.c
+++ b/src/3rdparty/libpng/pngwutil.c
@@ -13,6 +13,8 @@
#include "pngpriv.h"
+namespace PrivatePng {
+
#ifdef PNG_WRITE_SUPPORTED
#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED
@@ -3177,3 +3179,4 @@ png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row)
#endif
}
#endif /* PNG_WRITE_SUPPORTED */
+} // namespace PrivatePng
diff --git a/src/3rdparty/libpng/privatepng.cpp b/src/3rdparty/libpng/privatepng.cpp
new file mode 100644
index 0000000..6136447
--- /dev/null
+++ b/src/3rdparty/libpng/privatepng.cpp
@@ -0,0 +1,16 @@
+#include "png.c"
+#include "pngerror.c"
+#include "pngget.c"
+#include "pngmem.c"
+#include "pngpread.c"
+#include "pngread.c"
+#include "pngrio.c"
+#include "pngrtran.c"
+#include "pngrutil.c"
+#include "pngset.c"
+#include "pngtrans.c"
+#include "pngwio.c"
+#include "pngwrite.c"
+#include "pngwtran.c"
+#include "pngwutil.c"
+
diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/Source/JavaScriptCore/jit/JITStubs.cpp
index a589e11..e2f13e7 100644
--- a/src/3rdparty/webkit/Source/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/webkit/Source/JavaScriptCore/jit/JITStubs.cpp
@@ -353,7 +353,7 @@ asm volatile (
".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
- "mov.l .L2"SYMBOL_STRING(cti_vm_throw)",r0" "\n"
+ "mov.l .L2" SYMBOL_STRING(cti_vm_throw) ",r0" "\n"
"mov r15, r4" "\n"
"mov.l @(r0,r12),r11" "\n"
"jsr @r11" "\n"
@@ -369,7 +369,7 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
"rts" "\n"
"nop" "\n"
".align 2" "\n"
- ".L2"SYMBOL_STRING(cti_vm_throw)":.long " SYMBOL_STRING(cti_vm_throw)"@GOT \n"
+ ".L2" SYMBOL_STRING(cti_vm_throw)":.long " SYMBOL_STRING(cti_vm_throw) "@GOT \n"
);
asm volatile (
@@ -1239,7 +1239,7 @@ MSVC_END( END)
SYMBOL_STRING(cti_##op) ":" "\n" \
"sts pr, r11" "\n" \
"mov.l r11, @(0x38, r15)" "\n" \
- "mov.l .L2"SYMBOL_STRING(JITStubThunked_##op)",r0" "\n" \
+ "mov.l .L2" SYMBOL_STRING(JITStubThunked_##op) ",r0" "\n" \
"mov.l @(r0,r12),r11" "\n" \
"jsr @r11" "\n" \
"nop" "\n" \
@@ -1248,7 +1248,7 @@ MSVC_END( END)
"rts" "\n" \
"nop" "\n" \
".align 2" "\n" \
- ".L2"SYMBOL_STRING(JITStubThunked_##op)":.long " SYMBOL_STRING(JITStubThunked_##op)"@GOT \n" \
+ ".L2" SYMBOL_STRING(JITStubThunked_##op) ":.long " SYMBOL_STRING(JITStubThunked_##op)"@GOT \n" \
); \
rtype JITStubThunked_##op(STUB_ARGS_DECLARATION)
#else
diff --git a/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/common/debug.h b/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/common/debug.h
index 2c4ec70..19da378 100644
--- a/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/common/debug.h
+++ b/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/common/debug.h
@@ -20,21 +20,21 @@ namespace gl
// A macro to output a trace of a function call and its arguments to the debugging log
#if !defined(NDEBUG) && !defined(ANGLE_DISABLE_TRACE)
- #define TRACE(message, ...) gl::trace("trace: %s"message"\n", __FUNCTION__, __VA_ARGS__)
+ #define TRACE(message, ...) gl::trace("trace: %s" message "\n", __FUNCTION__, __VA_ARGS__)
#else
#define TRACE(...) ((void)0)
#endif
// A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing. Will occur even in release mode.
-#define FIXME(message, ...) gl::trace("fixme: %s"message"\n", __FUNCTION__, __VA_ARGS__)
+#define FIXME(message, ...) gl::trace("fixme: %s" message "\n", __FUNCTION__, __VA_ARGS__)
// A macro to output a function call and its arguments to the debugging log, in case of error. Will occur even in release mode.
-#define ERR(message, ...) gl::trace("err: %s"message"\n", __FUNCTION__, __VA_ARGS__)
+#define ERR(message, ...) gl::trace("err: %s" message "\n", __FUNCTION__, __VA_ARGS__)
// A macro asserting a condition and outputting failures to the debug log
#define ASSERT(expression) do { \
if(!(expression)) \
- ERR("\t! Assert failed in %s(%d): "#expression"\n", __FUNCTION__, __LINE__); \
+ ERR("\t! Assert failed in %s(%d): " #expression "\n", __FUNCTION__, __LINE__); \
assert(expression); \
} while(0)
diff --git a/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp b/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp
index 8dfe6e5..98251a1 100644
--- a/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp
+++ b/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp
@@ -197,7 +197,7 @@ const char *__stdcall eglQueryString(EGLDisplay dpy, EGLint name)
case EGL_VENDOR:
return success("TransGaming Inc.");
case EGL_VERSION:
- return success("1.4 (git-devel "__DATE__" " __TIME__")");
+ return success("1.4 (git-devel " __DATE__ " " __TIME__ ")");
}
return error(EGL_BAD_PARAMETER, (const char*)NULL);
diff --git a/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp b/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp
index 543c0d2..21bffa8 100644
--- a/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp
+++ b/src/3rdparty/webkit/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp
@@ -3214,9 +3214,9 @@ const GLubyte* __stdcall glGetString(GLenum name)
case GL_RENDERER:
return (GLubyte*)"ANGLE";
case GL_VERSION:
- return (GLubyte*)"OpenGL ES 2.0 (git-devel "__DATE__ " " __TIME__")";
+ return (GLubyte*)"OpenGL ES 2.0 (git-devel " __DATE__ " " __TIME__ ")";
case GL_SHADING_LANGUAGE_VERSION:
- return (GLubyte*)"OpenGL ES GLSL ES 1.00 (git-devel "__DATE__ " " __TIME__")";
+ return (GLubyte*)"OpenGL ES GLSL ES 1.00 (git-devel " __DATE__ " " __TIME__ ")";
case GL_EXTENSIONS:
return (GLubyte*)((context != NULL) ? context->getExtensionString() : "");
default:
diff --git a/src/3rdparty/webkit/Source/WebCore/platform/sql/SQLiteFileSystem.cpp b/src/3rdparty/webkit/Source/WebCore/platform/sql/SQLiteFileSystem.cpp
index 362005c..c4ca6aa 100644
--- a/src/3rdparty/webkit/Source/WebCore/platform/sql/SQLiteFileSystem.cpp
+++ b/src/3rdparty/webkit/Source/WebCore/platform/sql/SQLiteFileSystem.cpp
@@ -77,10 +77,10 @@ String SQLiteFileSystem::getFileNameForNewDatabase(const String& dbDir, const St
String fileName;
do {
++seq;
- fileName = pathByAppendingComponent(dbDir, String::format("%016"PRIx64".db", seq));
+ fileName = pathByAppendingComponent(dbDir, String::format("%016" PRIx64 ".db", seq));
} while (fileExists(fileName));
- return String::format("%016"PRIx64".db", seq);
+ return String::format("%016" PRIx64 ".db", seq);
}
String SQLiteFileSystem::appendDatabaseFileNameToPath(const String& path, const String& fileName)
diff --git a/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro b/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro
index 197aa98..4161832 100644
--- a/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro
+++ b/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro
@@ -123,7 +123,7 @@ symbian {
webkitlibs.pkg_prerules = vendorinfo
webkitbackup.sources = symbian/backup_registration.xml
- webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
+ webkitbackup.path = /private/10202d56/import/packages/$$replace(TARGET.UID3, 0x,)
contains(QT_CONFIG, declarative) {
declarativeImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
diff --git a/src/corelib/arch/qatomic_integrity.h b/src/corelib/arch/qatomic_integrity.h
index f957297..c72a48d 100644
--- a/src/corelib/arch/qatomic_integrity.h
+++ b/src/corelib/arch/qatomic_integrity.h
@@ -203,7 +203,7 @@ inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
template <typename T>
Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
{
- return TestAndSet((Address*)&_q_value, qt_addr(expectedValue), qt_addr(newValue)) == Success;
+ return TestAndSet(reinterpret_cast<Address *>(const_cast<T **>(&_q_value)), qt_addr(expectedValue), qt_addr(newValue)) == Success;
}
template <typename T>
@@ -231,7 +231,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
{
Address old_val;
do {
- old_val = *reinterpret_cast<Address *>(const_cast<T *>(newValue));
+ old_val = *reinterpret_cast<Address *>(const_cast<T *>(_q_value));
} while (TestAndSet(reinterpret_cast<Address *>(const_cast<T **>(&_q_value)), old_val, qt_addr(newValue)) != Success);
return reinterpret_cast<T *>(old_val);
}
@@ -259,7 +259,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
template <typename T>
Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
{
- AtomicModify(qt_p2addr(&_q_value), qt_addr(_q_value), qt_addr(_q_value) + valueToAdd * sizeof(T));
+ Address old_value;
+ AtomicModify(reinterpret_cast<volatile Address*>(&_q_value), &old_value, 0, valueToAdd * sizeof(T));
return _q_value;
}
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 84d68e5..3675fc7 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2207,16 +2207,13 @@ void qt_message_output(QtMsgType msgType, const char *buf)
OutputDebugString(reinterpret_cast<const wchar_t *> (fstr.utf16()));
#elif defined(Q_OS_SYMBIAN)
// RDebug::Print has a cap of 256 characters so break it up
- _LIT(format, "[Qt Message] %S");
- const int maxBlockSize = 256 - ((const TDesC &)format).Length();
+ char format[] = "[Qt Message] %S";
+ const int maxBlockSize = 256 - sizeof(format);
const TPtrC8 ptr(reinterpret_cast<const TUint8*>(buf));
- HBufC* hbuffer = HBufC::New(qMin(maxBlockSize, ptr.Length()));
- Q_CHECK_PTR(hbuffer);
- for (int i = 0; i < ptr.Length(); i += hbuffer->Length()) {
- hbuffer->Des().Copy(ptr.Mid(i, qMin(maxBlockSize, ptr.Length()-i)));
- RDebug::Print(format, hbuffer);
+ for (int i = 0; i < ptr.Length(); i += maxBlockSize) {
+ TPtrC8 part(ptr.Mid(i, qMin(maxBlockSize, ptr.Length()-i)));
+ RDebug::Printf(format, &part);
}
- delete hbuffer;
#else
fprintf(stderr, "%s\n", buf);
fflush(stderr);
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index cfe5eea..e8c611b 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1824,7 +1824,7 @@ inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; }
#elif defined(_MSC_VER)
# define Q_FUNC_INFO __FUNCSIG__
#else
-# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN)
+# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN) || defined(Q_OS_INTEGRITY)
# define Q_FUNC_INFO __FILE__ "(line number unavailable)"
# else
/* These two macros makes it possible to turn the builtin line expander into a
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index ea466f5..da6f021 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -749,7 +749,7 @@ public:
ObjectRun,
ObjectDelayed
};
- static RunResult RunMarkedIfReady(TInt &runPriority, TInt minimumPriority);
+ static RunResult RunMarkedIfReady(TInt &runPriority, TInt minimumPriority, QEventDispatcherSymbian *dispatcher);
static bool UseRRActiveScheduler();
private:
@@ -808,7 +808,7 @@ void QtRRActiveScheduler::MarkReadyToRun()
}
}
-QtRRActiveScheduler::RunResult QtRRActiveScheduler::RunMarkedIfReady(TInt &runPriority, TInt minimumPriority)
+QtRRActiveScheduler::RunResult QtRRActiveScheduler::RunMarkedIfReady(TInt &runPriority, TInt minimumPriority, QEventDispatcherSymbian *dispatcher)
{
RunResult result = NothingFound;
TInt error=KErrNone;
@@ -824,12 +824,12 @@ QtRRActiveScheduler::RunResult QtRRActiveScheduler::RunMarkedIfReady(TInt &runPr
runPriority = active->Priority();
dataAccess->iStatus.iFlags&=~TRequestStatusAccess::ERequestActiveFlags;
int vptr = *(int*)active; // vptr can be used to identify type when debugging leaves
- TRAP(error, active->RunL());
+ TRAP(error, QT_TRYCATCH_ERROR(error, active->RunL()));
if (error!=KErrNone)
error=active->RunError(error);
if (error) {
qWarning("Active object (ptr=0x%08x, vptr=0x%08x) leave: %i\n", active, vptr, error);
- pS->Error(error);
+ dispatcher->activeObjectError(error);
}
return ObjectRun;
}
@@ -966,13 +966,15 @@ QEventDispatcherSymbian::QEventDispatcherSymbian(QObject *parent)
m_wakeUpDone(0),
m_iterationCount(0),
m_insideTimerEvent(false),
- m_noSocketEvents(false)
+ m_noSocketEvents(false),
+ m_oomErrorCount(0)
{
#ifdef QT_SYMBIAN_PRIORITY_DROP
m_delay = baseDelay;
m_avgEventTime = 0;
idleDetectorThread();
#endif
+ m_oomErrorTimer.start();
}
QEventDispatcherSymbian::~QEventDispatcherSymbian()
@@ -1098,7 +1100,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla
// Standard or above priority AOs are scheduled round robin.
// Lower priority AOs can only run if nothing higher priority has run.
int runPriority = minPriority;
- handledSymbianEvent = QtRRActiveScheduler::RunMarkedIfReady(runPriority, minPriority);
+ handledSymbianEvent = QtRRActiveScheduler::RunMarkedIfReady(runPriority, minPriority, this);
minPriority = qMin(runPriority, int(CActive::EPriorityStandard));
} else {
TInt error;
@@ -1396,6 +1398,19 @@ QList<QEventDispatcherSymbian::TimerInfo> QEventDispatcherSymbian::registeredTim
return list;
}
+void QEventDispatcherSymbian::activeObjectError(int error)
+{
+ if (error == KErrNoMemory) {
+ // limit the number of reported out of memory errors, as the disappearance of the warning
+ // dialog can trigger further OOM errors causing a loop.
+ if (m_oomErrorTimer.restart() > 60000) // 1 minute
+ m_oomErrorCount = 0;
+ if (m_oomErrorCount++ >= 5)
+ return;
+ }
+ CActiveScheduler::Current()->Error(error);
+}
+
/*
* This active scheduler class implements a simple report and continue policy, for Symbian OS leaves
* or exceptions from Qt that fall back to the scheduler.
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 01f5ab1..869fe31 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -264,6 +264,8 @@ public:
static void RequestComplete(TRequestStatus *&status, TInt reason);
static void RequestComplete(RThread &threadHandle, TRequestStatus *&status, TInt reason);
+ void activeObjectError(int error);
+
private:
bool sendPostedEvents();
bool sendDeferredSocketEvents();
@@ -294,6 +296,8 @@ private:
int m_delay;
int m_avgEventTime;
QElapsedTimer m_lastIdleRequestTimer;
+ int m_oomErrorCount;
+ QElapsedTimer m_oomErrorTimer;
};
#ifdef QT_DEBUG
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index efce4d5..8cfc61a 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -219,7 +219,7 @@ Q_CORE_EXPORT const char *qFlagLocation(const char *method);
#define QTOSTRING_HELPER(s) #s
#define QTOSTRING(s) QTOSTRING_HELPER(s)
#ifndef QT_NO_DEBUG
-# define QLOCATION "\0"__FILE__":"QTOSTRING(__LINE__)
+# define QLOCATION "\0" __FILE__ ":" QTOSTRING(__LINE__)
# ifndef QT_NO_KEYWORDS
# define METHOD(a) qFlagLocation("0"#a QLOCATION)
# endif
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index dfc90e8..692c78c 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -408,13 +408,26 @@ bool QTranslator::load(const QString & filename, const QString & directory,
Q_D(QTranslator);
d->clear();
+ QString fname = filename;
QString prefix;
if (QFileInfo(filename).isRelative()) {
#ifdef Q_OS_SYMBIAN
- if (directory.isEmpty())
+ //TFindFile doesn't like path in the filename
+ QString dir(directory);
+ int slash = filename.lastIndexOf(QLatin1Char('/'));
+ slash = qMax(slash, filename.lastIndexOf(QLatin1Char('\\')));
+ if (slash >=0) {
+ //so move the path component into the directory prefix
+ if (dir.isEmpty())
+ dir = filename.left(slash + 1);
+ else
+ dir = dir + QLatin1Char('/') + filename.left(slash + 1);
+ fname = fname.mid(slash + 1);
+ }
+ if (dir.isEmpty())
prefix = QCoreApplication::applicationDirPath();
else
- prefix = QFileInfo(directory).absoluteFilePath(); //TFindFile doesn't like dirty paths
+ prefix = QFileInfo(dir).absoluteFilePath(); //TFindFile doesn't like dirty paths
if (prefix.length() > 2 && prefix.at(1) == QLatin1Char(':') && prefix.at(0).isLetter())
prefix[0] = QLatin1Char('Y');
#else
@@ -428,7 +441,6 @@ bool QTranslator::load(const QString & filename, const QString & directory,
QString nativePrefix = QDir::toNativeSeparators(prefix);
#endif
- QString fname = filename;
QString realname;
QString delims;
delims = search_delimiters.isNull() ? QString::fromLatin1("_.") : search_delimiters;
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index f1ed8e4..e0e2b8d 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -789,7 +789,7 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
// An exception was thrown when calling qt_plugin_query_verification_data().
// This usually happens when plugin is compiled with the /clr compiler flag,
// & will only work if the dependencies are loaded & DLLMain() is called.
- // LoadLibrary() will do this, try once with this & if it fails dont load.
+ // LoadLibrary() will do this, try once with this & if it fails don't load.
retryLoadLibrary = !retryLoadLibrary;
}
#endif
diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h
index 40e6e66..559822a 100644
--- a/src/corelib/plugin/qplugin.h
+++ b/src/corelib/plugin/qplugin.h
@@ -115,10 +115,10 @@ void Q_CORE_EXPORT qRegisterStaticPluginInstanceFunction(QtPluginInstanceFunctio
# endif
# define Q_PLUGIN_VERIFICATION_DATA \
static const char qt_plugin_verification_data[] = \
- "pattern=""QT_PLUGIN_VERIFICATION_DATA""\n" \
- "version="QT_VERSION_STR"\n" \
- "debug="QPLUGIN_DEBUG_STR"\n" \
- "buildkey="QT_BUILD_KEY;
+ "pattern=QT_PLUGIN_VERIFICATION_DATA\n" \
+ "version=" QT_VERSION_STR "\n" \
+ "debug=" QPLUGIN_DEBUG_STR "\n" \
+ "buildkey=" QT_BUILD_KEY;
# if defined (Q_OF_ELF) && defined (Q_CC_GNU)
# define Q_PLUGIN_VERIFICATION_SECTION \
diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp
index df31bf9..750379c 100644
--- a/src/corelib/tools/qlocale_tools.cpp
+++ b/src/corelib/tools/qlocale_tools.cpp
@@ -2253,6 +2253,13 @@ static int quorem(Bigint *b, Bigint *S)
* calculation.
*/
+#if defined(Q_OS_WIN) && defined (Q_CC_GNU) && !defined(_clear87) // See QTBUG-7576
+extern "C" {
+__attribute__ ((dllimport)) unsigned int __cdecl __MINGW_NOTHROW _control87 (unsigned int unNew, unsigned int unMask);
+__attribute__ ((dllimport)) unsigned int __cdecl __MINGW_NOTHROW _clearfp (void); /* Clear the FPU status word */
+}
+# define _clear87 _clearfp
+#endif
/* This actually sometimes returns a pointer to a string literal
cast to a char*. Do NOT try to modify the return value. */
diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp
index 3e0c326..05f63c7 100644
--- a/src/declarative/debugger/qdeclarativedebugserver.cpp
+++ b/src/declarative/debugger/qdeclarativedebugserver.cpp
@@ -96,7 +96,7 @@ public:
private:
// private slot
void _q_deliverMessage(const QString &serviceName, const QByteArray &message);
- static QDeclarativeDebugServerConnection *loadConnectionPlugin(const QString &pluginName);
+ static QDeclarativeDebugServerConnection *loadConnectionPlugin(QPluginLoader *loader, const QString &pluginName);
};
QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() :
@@ -120,7 +120,7 @@ void QDeclarativeDebugServerPrivate::advertisePlugins()
}
QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectionPlugin(
- const QString &pluginName)
+ QPluginLoader *loader, const QString &pluginName)
{
#ifndef QT_NO_LIBRARY
QStringList pluginCandidates;
@@ -137,17 +137,17 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio
}
foreach (const QString &pluginPath, pluginCandidates) {
- QPluginLoader loader(pluginPath);
- if (!loader.load()) {
+ loader->setFileName(pluginPath);
+ if (!loader->load()) {
continue;
}
QDeclarativeDebugServerConnection *connection = 0;
- if (QObject *instance = loader.instance())
+ if (QObject *instance = loader->instance())
connection = qobject_cast<QDeclarativeDebugServerConnection*>(instance);
if (connection)
return connection;
- loader.unload();
+ loader->unload();
}
#endif
return 0;
@@ -202,8 +202,9 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
if (ok) {
server = new QDeclarativeDebugServer();
+ QPluginLoader *loader = new QPluginLoader(server);
QDeclarativeDebugServerConnection *connection
- = QDeclarativeDebugServerPrivate::loadConnectionPlugin(pluginName);
+ = QDeclarativeDebugServerPrivate::loadConnectionPlugin(loader, pluginName);
if (connection) {
server->d_func()->connection = connection;
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 7b4dc5c..ef7e25f 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -1628,7 +1628,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
to set \e {clip: true} in order to have the out of view items clipped
nicely.
- \sa {QML Data Models}, GridView, {declarative/modelviews/listview}{ListView examples}
+ \sa {QML Data Models}, GridView, {Models and Views: ListView Examples}{ListView examples}
*/
QDeclarativeListView::QDeclarativeListView(QDeclarativeItem *parent)
@@ -1956,7 +1956,7 @@ int QDeclarativeListView::count() const
so as to stay with the current item, unless the highlightFollowsCurrentItem
property is false.
- \sa highlightItem, highlightFollowsCurrentItem, {declarative/modelviews/listview}{ListView examples}
+ \sa highlightItem, highlightFollowsCurrentItem, {Models and Views: ListView Examples}{ListView examples}
*/
QDeclarativeComponent *QDeclarativeListView::highlight() const
{
@@ -2344,7 +2344,7 @@ void QDeclarativeListView::setCacheBuffer(int b)
differing sections will result in a section header being created
even if that section exists elsewhere.
- \sa {declarative/modelviews/listview}{ListView examples}
+ \sa {Models and Views: ListView Examples}{ListView examples}
*/
QDeclarativeViewSection *QDeclarativeListView::sectionCriteria()
{
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 20e4eef..684dc5a 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -289,7 +289,7 @@ void QDeclarativeTextPrivate::updateSize()
doc->setTextWidth(-1);
naturalWidth = doc->idealWidth();
}
- if (wrapMode != QDeclarativeText::NoWrap && q->widthValid())
+ if (q->widthValid())
doc->setTextWidth(q->width());
else
doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug)
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index f423f50..0d892a2 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -936,50 +936,37 @@ void QDeclarativeComponentPrivate::beginDeferred(QDeclarativeEnginePrivate *engi
void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state)
{
if (state->completePending) {
-
- for (int ii = 0; ii < state->bindValues.count(); ++ii) {
- QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> bv =
- state->bindValues.at(ii);
- for (int jj = 0; jj < bv.count; ++jj) {
- if(bv.at(jj)) {
- // XXX akennedy
- bv.at(jj)->m_mePtr = 0;
- bv.at(jj)->setEnabled(true, QDeclarativePropertyPrivate::BypassInterceptor |
- QDeclarativePropertyPrivate::DontRemoveBinding);
+ QT_TRY {
+ for (int ii = 0; ii < state->bindValues.count(); ++ii) {
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> bv =
+ state->bindValues.at(ii);
+ for (int jj = 0; jj < bv.count; ++jj) {
+ if(bv.at(jj)) {
+ // XXX akennedy
+ bv.at(jj)->m_mePtr = 0;
+ bv.at(jj)->setEnabled(true, QDeclarativePropertyPrivate::BypassInterceptor |
+ QDeclarativePropertyPrivate::DontRemoveBinding);
+ }
}
+ QDeclarativeEnginePrivate::clear(bv);
}
- QDeclarativeEnginePrivate::clear(bv);
- }
- for (int ii = 0; ii < state->parserStatus.count(); ++ii) {
- QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> ps =
- state->parserStatus.at(ii);
+ for (int ii = 0; ii < state->parserStatus.count(); ++ii) {
+ QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> ps =
+ state->parserStatus.at(ii);
- for (int jj = ps.count - 1; jj >= 0; --jj) {
- QDeclarativeParserStatus *status = ps.at(jj);
- if (status && status->d) {
- status->d = 0;
- status->componentComplete();
+ for (int jj = ps.count - 1; jj >= 0; --jj) {
+ QDeclarativeParserStatus *status = ps.at(jj);
+ if (status && status->d) {
+ status->d = 0;
+ status->componentComplete();
+ }
}
+ QDeclarativeEnginePrivate::clear(ps);
}
- QDeclarativeEnginePrivate::clear(ps);
- }
-
- for (int ii = 0; ii < state->finalizedParserStatus.count(); ++ii) {
- QPair<QDeclarativeGuard<QObject>, int> status = state->finalizedParserStatus.at(ii);
- QObject *obj = status.first;
- if (obj) {
- void *args[] = { 0 };
- QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod,
- status.second, args);
- }
- }
- //componentComplete() can register additional finalization objects
- //that are then never handled. Handle them manually here.
- if (1 == enginePriv->inProgressCreations) {
- for (int ii = 0; ii < enginePriv->finalizedParserStatus.count(); ++ii) {
- QPair<QDeclarativeGuard<QObject>, int> status = enginePriv->finalizedParserStatus.at(ii);
+ for (int ii = 0; ii < state->finalizedParserStatus.count(); ++ii) {
+ QPair<QDeclarativeGuard<QObject>, int> status = state->finalizedParserStatus.at(ii);
QObject *obj = status.first;
if (obj) {
void *args[] = { 0 };
@@ -987,17 +974,38 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri
status.second, args);
}
}
- enginePriv->finalizedParserStatus.clear();
- }
- while (state->componentAttached) {
- QDeclarativeComponentAttached *a = state->componentAttached;
- a->rem();
- QDeclarativeData *d = QDeclarativeData::get(a->parent());
- Q_ASSERT(d);
- Q_ASSERT(d->context);
- a->add(&d->context->componentAttached);
- emit a->completed();
+ //componentComplete() can register additional finalization objects
+ //that are then never handled. Handle them manually here.
+ if (1 == enginePriv->inProgressCreations) {
+ for (int ii = 0; ii < enginePriv->finalizedParserStatus.count(); ++ii) {
+ QPair<QDeclarativeGuard<QObject>, int> status = enginePriv->finalizedParserStatus.at(ii);
+ QObject *obj = status.first;
+ if (obj) {
+ void *args[] = { 0 };
+ QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod,
+ status.second, args);
+ }
+ }
+ enginePriv->finalizedParserStatus.clear();
+ }
+
+ while (state->componentAttached) {
+ QDeclarativeComponentAttached *a = state->componentAttached;
+ a->rem();
+ QDeclarativeData *d = QDeclarativeData::get(a->parent());
+ Q_ASSERT(d);
+ Q_ASSERT(d->context);
+ a->add(&d->context->componentAttached);
+ emit a->completed();
+ }
+ } QT_CATCH(const std::exception&) {
+ state->bindValues.clear();
+ state->parserStatus.clear();
+ state->finalizedParserStatus.clear();
+ state->completePending = false;
+ enginePriv->inProgressCreations--;
+ QT_RETHROW;
}
state->bindValues.clear();
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 1417b78..89a9809 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -1202,8 +1202,8 @@ void QDeclarativeData::setBindingBit(QObject *obj, int bit)
int arraySize = (props + 31) / 32;
int oldArraySize = bindingBitsSize / 32;
- bindingBits = (quint32 *)realloc(bindingBits,
- arraySize * sizeof(quint32));
+ bindingBits = (quint32 *)q_check_ptr(realloc(bindingBits,
+ arraySize * sizeof(quint32)));
memset(bindingBits + oldArraySize,
0x00,
diff --git a/src/declarative/qml/qpodvector_p.h b/src/declarative/qml/qpodvector_p.h
index 7b50463..a055d17 100644
--- a/src/declarative/qml/qpodvector_p.h
+++ b/src/declarative/qml/qpodvector_p.h
@@ -89,7 +89,7 @@ public:
void insert(int idx, const T &v) {
if (m_count == m_capacity) {
m_capacity += Increment;
- m_data = (T *)realloc(m_data, m_capacity * sizeof(T));
+ m_data = (T *)q_check_ptr(realloc(m_data, m_capacity * sizeof(T)));
}
int moveCount = m_count - idx;
if (moveCount)
@@ -101,7 +101,7 @@ public:
void reserve(int count) {
if (count >= m_capacity) {
m_capacity = (count + (Increment-1)) & (0xFFFFFFFF - Increment + 1);
- m_data = (T *)realloc(m_data, m_capacity * sizeof(T));
+ m_data = (T *)q_check_ptr(realloc(m_data, m_capacity * sizeof(T)));
}
}
diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp
index 3557425..b23ac73 100644
--- a/src/declarative/util/qdeclarativepixmapcache.cpp
+++ b/src/declarative/util/qdeclarativepixmapcache.cpp
@@ -90,8 +90,9 @@ public:
~QDeclarativePixmapReply();
QDeclarativePixmapData *data;
- QDeclarativePixmapReader *reader;
+ QDeclarativeEngine *engineForReader; // always access reader inside readerMutex.
QSize requestSize;
+ QUrl url;
bool loading;
int redirectCount;
@@ -147,6 +148,7 @@ public:
void cancel(QDeclarativePixmapReply *rep);
static QDeclarativePixmapReader *instance(QDeclarativeEngine *engine);
+ static QDeclarativePixmapReader *existingInstance(QDeclarativeEngine *engine);
protected:
void run();
@@ -176,6 +178,7 @@ private:
static int downloadProgress;
static int threadNetworkRequestDone;
static QHash<QDeclarativeEngine *,QDeclarativePixmapReader*> readers;
+public:
static QMutex readerMutex;
};
@@ -326,6 +329,22 @@ QDeclarativePixmapReader::~QDeclarativePixmapReader()
readers.remove(engine);
readerMutex.unlock();
+ mutex.lock();
+ // manually cancel all outstanding jobs.
+ foreach (QDeclarativePixmapReply *reply, jobs) {
+ delete reply;
+ }
+ jobs.clear();
+ QList<QDeclarativePixmapReply*> activeJobs = replies.values();
+ foreach (QDeclarativePixmapReply *reply, activeJobs) {
+ if (reply->loading) {
+ cancelled.append(reply);
+ reply->data = 0;
+ }
+ }
+ if (threadObject) threadObject->processJobs();
+ mutex.unlock();
+
eventLoopQuitHack->deleteLater();
wait();
}
@@ -433,9 +452,8 @@ void QDeclarativePixmapReader::processJobs()
if (!jobs.isEmpty() && replies.count() < IMAGEREQUEST_MAX_REQUEST_COUNT) {
QDeclarativePixmapReply *runningJob = jobs.takeLast();
runningJob->loading = true;
-
- QUrl url = runningJob->data->url;
- QSize requestSize = runningJob->data->requestSize;
+ QUrl url = runningJob->url;
+ QSize requestSize = runningJob->requestSize;
locker.unlock();
processJob(runningJob, url, requestSize);
locker.relock();
@@ -459,7 +477,6 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, c
errorCode = QDeclarativePixmapReply::Loading;
errorStr = QDeclarativePixmap::tr("Failed to get image from provider: %1").arg(url.toString());
}
-
mutex.lock();
if (!cancelled.contains(runningJob)) runningJob->postReply(errorCode, errorStr, readSize, image);
mutex.unlock();
@@ -487,10 +504,8 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, c
QNetworkRequest req(url);
req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
QNetworkReply *reply = networkAccessManager()->get(req);
-
QMetaObject::connect(reply, replyDownloadProgress, runningJob, downloadProgress);
QMetaObject::connect(reply, replyFinished, threadObject, threadNetworkRequestDone);
-
replies.insert(reply, runningJob);
}
}
@@ -498,22 +513,27 @@ void QDeclarativePixmapReader::processJob(QDeclarativePixmapReply *runningJob, c
QDeclarativePixmapReader *QDeclarativePixmapReader::instance(QDeclarativeEngine *engine)
{
- readerMutex.lock();
+ // XXX NOTE: must be called within readerMutex locking.
QDeclarativePixmapReader *reader = readers.value(engine);
if (!reader) {
reader = new QDeclarativePixmapReader(engine);
readers.insert(engine, reader);
}
- readerMutex.unlock();
return reader;
}
+QDeclarativePixmapReader *QDeclarativePixmapReader::existingInstance(QDeclarativeEngine *engine)
+{
+ // XXX NOTE: must be called within readerMutex locking.
+ return readers.value(engine, 0);
+}
+
QDeclarativePixmapReply *QDeclarativePixmapReader::getImage(QDeclarativePixmapData *data)
{
mutex.lock();
QDeclarativePixmapReply *reply = new QDeclarativePixmapReply(data);
- reply->reader = this;
+ reply->engineForReader = engine;
jobs.append(reply);
// XXX
if (threadObject) threadObject->processJobs();
@@ -692,7 +712,7 @@ void QDeclarativePixmapStore::flushCache()
}
QDeclarativePixmapReply::QDeclarativePixmapReply(QDeclarativePixmapData *d)
-: data(d), reader(0), requestSize(d->requestSize), loading(false), redirectCount(0)
+: data(d), engineForReader(0), requestSize(d->requestSize), url(d->url), loading(false), redirectCount(0)
{
if (finishedIndex == -1) {
finishedIndex = QDeclarativePixmapReply::staticMetaObject.indexOfSignal("finished()");
@@ -750,8 +770,14 @@ void QDeclarativePixmapData::release()
if (refCount == 0) {
if (reply) {
- reply->reader->cancel(reply);
+ QDeclarativePixmapReply *cancelReply = reply;
+ reply->data = 0;
reply = 0;
+ QDeclarativePixmapReader::readerMutex.lock();
+ QDeclarativePixmapReader *reader = QDeclarativePixmapReader::existingInstance(cancelReply->engineForReader);
+ if (reader)
+ reader->cancel(cancelReply);
+ QDeclarativePixmapReader::readerMutex.unlock();
}
if (pixmapStatus == QDeclarativePixmap::Ready) {
@@ -1013,13 +1039,12 @@ void QDeclarativePixmap::load(QDeclarativeEngine *engine, const QUrl &url, const
if (!engine)
return;
- QDeclarativePixmapReader *reader = QDeclarativePixmapReader::instance(engine);
-
d = new QDeclarativePixmapData(url, requestSize);
if (options & QDeclarativePixmap::Cache)
d->addToCache();
-
- d->reply = reader->getImage(d);
+ QDeclarativePixmapReader::readerMutex.lock();
+ d->reply = QDeclarativePixmapReader::instance(engine)->getImage(d);
+ QDeclarativePixmapReader::readerMutex.unlock();
} else {
d = *iter;
d->addref();
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 817cd38..970d111 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -869,6 +869,7 @@ Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded
if (!path.startsWith(QLatin1Char('~')))
return path;
QString ret = path;
+#if !defined(Q_OS_INTEGRITY)
QStringList tokens = ret.split(QDir::separator());
if (tokens.first() == QLatin1String("~")) {
ret.replace(0, 1, QDir::homePath());
@@ -899,6 +900,7 @@ Q_AUTOTEST_EXPORT QString qt_tildeExpansion(const QString &path, bool *expanded
}
if (expanded != 0)
*expanded = true;
+#endif
return ret;
}
#endif
diff --git a/src/gui/embedded/qscreenintegrityfb_qws.cpp b/src/gui/embedded/qscreenintegrityfb_qws.cpp
index 6f30812..5b1e0d5 100644
--- a/src/gui/embedded/qscreenintegrityfb_qws.cpp
+++ b/src/gui/embedded/qscreenintegrityfb_qws.cpp
@@ -64,7 +64,8 @@ public:
~QIntfbScreenPrivate();
FBHandle handle;
- struct FBInfoStruct fbinfo;
+ FBInfo fbinfo;
+ FBDriver *fbdrv;
QWSMouseHandler *mouse;
#ifndef QT_NO_QWS_KEYBOARD
@@ -172,15 +173,14 @@ static QIntfbScreen *connected = 0;
bool QIntfbScreen::connect(const QString &displaySpec)
{
- FBDriver *fbdev;
-
- CheckSuccess(gh_FB_get_driver(0, &fbdev));
- CheckSuccess(gh_FB_init_device(fbdev, 0, &d_ptr->handle));
+ CheckSuccess(gh_FB_get_driver(0, &d_ptr->fbdrv));
+ CheckSuccess(gh_FB_check_info(d_ptr->fbdrv, &d_ptr->fbinfo));
+ CheckSuccess(gh_FB_open(d_ptr->fbdrv, &d_ptr->fbinfo, &d_ptr->handle));
CheckSuccess(gh_FB_get_info(d_ptr->handle, &d_ptr->fbinfo));
- data = (uchar *)d_ptr->fbinfo.start;
+ data = (uchar *)d_ptr->fbinfo.Start;
- d = d_ptr->fbinfo.bitsperpixel;
+ d = d_ptr->fbinfo.BitsPerPixel;
switch (d) {
case 1:
setPixelFormat(QImage::Format_Mono);
@@ -205,24 +205,24 @@ bool QIntfbScreen::connect(const QString &displaySpec)
#ifdef QT_QWS_DEPTH_GENERIC
#if Q_BYTE_ORDER != Q_BIG_ENDIAN
qt_set_generic_blit(this, 24,
- d_ptr->fbinfo.redbits,
- d_ptr->fbinfo.greenbits,
- d_ptr->fbinfo.bluebits,
- d_ptr->fbinfo.alphabits,
- d_ptr->fbinfo.redoffset,
- d_ptr->fbinfo.greenoffset,
- d_ptr->fbinfo.blueoffset,
- d_ptr->fbinfo.alphaoffset);
+ d_ptr->fbinfo.Red.Bits,
+ d_ptr->fbinfo.Green.Bits,
+ d_ptr->fbinfo.Blue.Bits,
+ d_ptr->fbinfo.Alpha.Bits,
+ d_ptr->fbinfo.Red.Offset,
+ d_ptr->fbinfo.Green.Offset,
+ d_ptr->fbinfo.Blue.Offset,
+ d_ptr->fbinfo.Alpha.Offset);
#else
qt_set_generic_blit(this, 24,
- d_ptr->fbinfo.redbits,
- d_ptr->fbinfo.greenbits,
- d_ptr->fbinfo.bluebits,
- d_ptr->fbinfo.alphabits,
- 16 - d_ptr->fbinfo.redoffset,
- 16 - d_ptr->fbinfo.greenoffset,
- 16 - d_ptr->fbinfo.blueoffset,
- d_ptr->fbinfo.alphaoffset);
+ d_ptr->fbinfo.Red.Bits,
+ d_ptr->fbinfo.Green.Bits,
+ d_ptr->fbinfo.Blue.Bits,
+ d_ptr->fbinfo.Alpha.Bits,
+ 16 - d_ptr->fbinfo.Red.Offset,
+ 16 - d_ptr->fbinfo.Green.Offset,
+ 16 - d_ptr->fbinfo.Blue.Offset,
+ 16 - d_ptr->fbinfo.Alpha.Offset);
#endif
#endif
break;
@@ -231,31 +231,31 @@ bool QIntfbScreen::connect(const QString &displaySpec)
#ifdef QT_QWS_DEPTH_GENERIC
#if Q_BYTE_ORDER != Q_BIG_ENDIAN
qt_set_generic_blit(this, 32,
- d_ptr->fbinfo.redbits,
- d_ptr->fbinfo.greenbits,
- d_ptr->fbinfo.bluebits,
- d_ptr->fbinfo.alphabits,
- d_ptr->fbinfo.redoffset,
- d_ptr->fbinfo.greenoffset,
- d_ptr->fbinfo.blueoffset,
- d_ptr->fbinfo.alphaoffset);
+ d_ptr->fbinfo.Red.Bits,
+ d_ptr->fbinfo.Green.Bits,
+ d_ptr->fbinfo.Blue.Bits,
+ d_ptr->fbinfo.Alpha.Bits,
+ d_ptr->fbinfo.Red.Offset,
+ d_ptr->fbinfo.Green.Offset,
+ d_ptr->fbinfo.Blue.Offset,
+ d_ptr->fbinfo.Alpha.Offset);
#else
qt_set_generic_blit(this, 32,
- d_ptr->fbinfo.redbits,
- d_ptr->fbinfo.greenbits,
- d_ptr->fbinfo.bluebits,
- d_ptr->fbinfo.alphabits,
- 24 - d_ptr->fbinfo.redoffset,
- 24 - d_ptr->fbinfo.greenoffset,
- 24 - d_ptr->fbinfo.blueoffset,
- d_ptr->fbinfo.alphaoffset ? 24 - d_ptr->fbinfo.alphaoffset : 0);
+ d_ptr->fbinfo.Red.Bits,
+ d_ptr->fbinfo.Green.Bits,
+ d_ptr->fbinfo.Blue.Bits,
+ d_ptr->fbinfo.Alpha.Bits,
+ 24 - d_ptr->fbinfo.Red.Offset,
+ 24 - d_ptr->fbinfo.Green.Offset,
+ 24 - d_ptr->fbinfo.Blue.Offset,
+ 24 - d_ptr->fbinfo.Alpha.Offset);
#endif
#endif
break;
}
- dw = w = d_ptr->fbinfo.width;
- dh = h = d_ptr->fbinfo.height;
+ dw = w = d_ptr->fbinfo.Width;
+ dh = h = d_ptr->fbinfo.Height;
/* assumes no padding */
lstep = w * ((d + 7) >> 3);
@@ -286,72 +286,6 @@ void QIntfbScreen::disconnect()
bool QIntfbScreen::initDevice()
{
-
- CheckSuccess(gh_FB_set_info(d_ptr->handle, &d_ptr->fbinfo, false));
- CheckSuccess(gh_FB_get_info(d_ptr->handle, &d_ptr->fbinfo));
- data = (uchar *)d_ptr->fbinfo.start;
- d = d_ptr->fbinfo.bitsperpixel;
- dw = w = d_ptr->fbinfo.width;
- dh = h = d_ptr->fbinfo.height;
- mapsize = d_ptr->fbinfo.length;
- /* assumes no padding */
- lstep = w * ((d + 7) >> 3);
-
- mapsize = size = h * lstep;
-
- data = (uchar *)d_ptr->fbinfo.start;
-
- d = d_ptr->fbinfo.bitsperpixel;
- switch (d) {
- case 1:
- setPixelFormat(QImage::Format_Mono);
- break;
- case 8:
- setPixelFormat(QImage::Format_Indexed8);
- break;
- case 12:
- setPixelFormat(QImage::Format_RGB444);
- break;
- case 15:
- setPixelFormat(QImage::Format_RGB555);
- break;
- case 16:
- setPixelFormat(QImage::Format_RGB16);
- break;
- case 18:
- setPixelFormat(QImage::Format_RGB666);
- break;
- case 24:
- setPixelFormat(QImage::Format_RGB888);
- break;
- case 32:
- setPixelFormat(QImage::Format_ARGB32_Premultiplied);
- break;
- }
-#ifdef QT_QWS_DEPTH_GENERIC
-#if defined(__BIG_ENDIAN__)
- qt_set_generic_blit(this, d,
- d_ptr->fbinfo.redbits,
- d_ptr->fbinfo.greenbits,
- d_ptr->fbinfo.bluebits,
- d_ptr->fbinfo.alphabits,
- 24 - d_ptr->fbinfo.redoffset,
- 24 - d_ptr->fbinfo.greenoffset,
- 24 - d_ptr->fbinfo.blueoffset,
- d_ptr->fbinfo.alphaoffset ? 24 - d_ptr->fbinfo.alphaoffset : 0);
-#else
- qt_set_generic_blit(this, d,
- d_ptr->fbinfo.redbits,
- d_ptr->fbinfo.greenbits,
- d_ptr->fbinfo.bluebits,
- d_ptr->fbinfo.alphabits,
- d_ptr->fbinfo.redoffset,
- d_ptr->fbinfo.greenoffset,
- d_ptr->fbinfo.blueoffset,
- d_ptr->fbinfo.alphaoffset);
-#endif
-#endif
-
#ifndef QT_NO_QWS_CURSOR
QScreenCursor::initSoftwareCursor();
#endif
@@ -384,9 +318,9 @@ void QIntfbScreen::setDirty(const QRect& rect)
FBRect fbrect;
fbrect.dx = rect.x();
fbrect.dy = rect.y();
- fbrect.width = rect.width();
- fbrect.height = rect.height();
- gh_FB_expose(d_ptr->handle, &fbrect);
+ fbrect.Width = rect.width();
+ fbrect.Height = rect.height();
+ gh_FB_expose(d_ptr->handle, &fbrect, 0);
}
void QIntfbScreen::setBrightness(int b)
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 73e8eed..9ea0b83 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1157,7 +1157,6 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
if (q_ptr == fsi || q_ptr->isAncestorOf(fsi)) {
parentFocusScopeItem = fsi;
p->d_ptr->focusScopeItem = 0;
- fsi->d_ptr->focusScopeItemChange(false);
}
break;
}
@@ -1261,6 +1260,10 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q
if (!inDestructor && (transformData || (newParent && newParent->d_ptr->transformData)))
transformChanged();
+ // Reparenting is finished, now safe to notify the previous focusScopeItem about changes
+ if (parentFocusScopeItem)
+ parentFocusScopeItem->d_ptr->focusScopeItemChange(false);
+
// Restore the sub focus chain.
if (subFocusItem) {
subFocusItem->d_ptr->setSubFocus(newParent);
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 411e5e9..2b56e49 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -1473,11 +1473,16 @@ QByteArray QImageReader::imageFormat(QIODevice *device)
\row \o XBM \o X11 Bitmap
\row \o XPM \o X11 Pixmap
\row \o SVG \o Scalable Vector Graphics
+ \row \o TGA \o Targa Image Format
\endtable
Reading and writing SVG files is supported through Qt's
\l{QtSvg Module}{SVG Module}.
+ TGA support only extends to reading non-RLE compressed files. In particular
+ calls to \l{http://doc.qt.nokia.com/4.7-snapshot/qimageioplugin.html#capabilities}{capabilities}
+ for the tga plugin returns only QImageIOPlugin::CanRead, not QImageIOPlugin::CanWrite.
+
To configure Qt with GIF support, pass \c -qt-gif to the \c
configure script or check the appropriate option in the graphical
installer.
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index 1714442..5a4a4d7 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -53,6 +53,7 @@
#ifdef QT_USE_BUNDLED_LIBPNG
#include <../../3rdparty/libpng/png.h>
#include <../../3rdparty/libpng/pngconf.h>
+using namespace PrivatePng;
#else
#include <png.h>
#include <pngconf.h>
diff --git a/src/gui/image/qtiffhandler.cpp b/src/gui/image/qtiffhandler.cpp
index 4dc9775..51a500d 100644
--- a/src/gui/image/qtiffhandler.cpp
+++ b/src/gui/image/qtiffhandler.cpp
@@ -158,7 +158,13 @@ bool QTiffHandler::canRead(QIODevice *device)
// current implementation uses TIFFClientOpen which needs to be
// able to seek, so sequential devices are not supported
+ int pos = device->pos();
+ if (pos != 0)
+ device->seek(0); // need the magic from the beginning
QByteArray header = device->peek(4);
+ if (pos != 0)
+ device->seek(pos); // put it back where we found it
+
return header == QByteArray::fromRawData("\x49\x49\x2A\x00", 4)
|| header == QByteArray::fromRawData("\x4D\x4D\x00\x2A", 4);
}
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 90d47f9..b17d9c7 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -162,6 +162,8 @@ private:
void enableSymbianCcpuSupport();
void changeCBA(bool showCopyAndOrPaste);
void copyOrCutTextToClipboard(const char *operation);
+ void getScreenCoordinatesForFepX(TPoint& aLeftSideOfBaseLine, TInt& aHeight, TInt& aAscent,
+ TInt aDocumentPosition) const;
//From MEikCcpuEditor interface
public:
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index ed7411f..44e0df0 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -1465,40 +1465,49 @@ void QCoeFepInputContext::CancelFepInlineEdit()
m_pendingTransactionCancel = true;
- QList<QInputMethodEvent::Attribute> attributes;
- QInputMethodEvent event(QLatin1String(""), attributes);
- event.setCommitString(QLatin1String(""), 0, 0);
- m_preeditString.clear();
- m_inlinePosition = 0;
- sendEvent(event);
-
- // Sync with native side editor state. Native side can then do various operations
- // based on editor state, such as removing 'exact word bubble'.
- if (!m_pendingInputCapabilitiesChanged)
- ReportAknEdStateEvent(MAknEdStateObserver::EAknSyncEdwinState);
+ QT_TRY {
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event(QLatin1String(""), attributes);
+ event.setCommitString(QLatin1String(""), 0, 0);
+ m_preeditString.clear();
+ m_inlinePosition = 0;
+ sendEvent(event);
+
+ // Sync with native side editor state. Native side can then do various operations
+ // based on editor state, such as removing 'exact word bubble'.
+ if (!m_pendingInputCapabilitiesChanged)
+ ReportAknEdStateEvent(MAknEdStateObserver::EAknSyncEdwinState);
+ } QT_CATCH(const std::exception&) {
+ m_preeditString.clear();
+ m_inlinePosition = 0;
+ }
m_pendingTransactionCancel = false;
}
TInt QCoeFepInputContext::DocumentLengthForFep() const
{
- QWidget *w = focusWidget();
- if (!w)
- return 0;
+ QT_TRY {
+ QWidget *w = focusWidget();
+ if (!w)
+ return 0;
- QVariant variant = w->inputMethodQuery(Qt::ImSurroundingText);
+ QVariant variant = w->inputMethodQuery(Qt::ImSurroundingText);
- int size = variant.value<QString>().size() + m_preeditString.size();
+ int size = variant.value<QString>().size() + m_preeditString.size();
- // To fix an issue with backspaces not being generated if document size is zero,
- // fake document length to be at least one always, except when dealing with
- // hidden text widgets, where this faking would generate extra asterisk. Since the
- // primary use of hidden text widgets is password fields, they are unlikely to
- // support multiple lines anyway.
- if (size == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText))
- size = 1;
+ // To fix an issue with backspaces not being generated if document size is zero,
+ // fake document length to be at least one always, except when dealing with
+ // hidden text widgets, where this faking would generate extra asterisk. Since the
+ // primary use of hidden text widgets is password fields, they are unlikely to
+ // support multiple lines anyway.
+ if (size == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText))
+ size = 1;
- return size;
+ return size;
+ } QT_CATCH(const std::exception&) {
+ return 0;
+ }
}
TInt QCoeFepInputContext::DocumentMaximumLengthForFep() const
@@ -1540,42 +1549,46 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur
void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const
{
- QWidget *w = focusWidget();
- if (!w) {
- aCursorSelection.SetSelection(0,0);
- return;
- }
+ QT_TRY {
+ QWidget *w = focusWidget();
+ if (!w) {
+ aCursorSelection.SetSelection(0,0);
+ return;
+ }
- int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size();
- int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size();
+ int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size();
+ int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size();
- // If the position is stored, use that value, so that word replacement from proposed word
- // lists are added to the correct position.
- if (m_cachedCursorAndAnchorPosition != -1) {
- cursor = m_cachedCursorAndAnchorPosition;
- anchor = m_cachedCursorAndAnchorPosition;
- }
- QString text = w->inputMethodQuery(Qt::ImSurroundingText).value<QString>();
- int combinedSize = text.size() + m_preeditString.size();
- if (combinedSize < anchor || combinedSize < cursor) {
- // ### TODO! FIXME! QTBUG-5050
- // This is a hack to prevent crashing in 4.6 with QLineEdits that use input masks.
- // The root problem is that cursor position is relative to displayed text instead of the
- // actual text we get.
- //
- // To properly fix this we would need to know the displayText of QLineEdits instead
- // of just the text, which on itself should be a trivial change. The difficulties start
- // when we need to commit the changes back to the QLineEdit, which would have to be somehow
- // able to handle displayText, too.
- //
- // Until properly fixed, the cursor and anchor positions will not reflect correct positions
- // for masked QLineEdits, unless all the masked positions are filled in order so that
- // cursor position relative to the displayed text matches position relative to actual text.
- aCursorSelection.iAnchorPos = combinedSize;
- aCursorSelection.iCursorPos = combinedSize;
- } else {
- aCursorSelection.iAnchorPos = anchor;
- aCursorSelection.iCursorPos = cursor;
+ // If the position is stored, use that value, so that word replacement from proposed word
+ // lists are added to the correct position.
+ if (m_cachedCursorAndAnchorPosition != -1) {
+ cursor = m_cachedCursorAndAnchorPosition;
+ anchor = m_cachedCursorAndAnchorPosition;
+ }
+ QString text = w->inputMethodQuery(Qt::ImSurroundingText).value<QString>();
+ int combinedSize = text.size() + m_preeditString.size();
+ if (combinedSize < anchor || combinedSize < cursor) {
+ // ### TODO! FIXME! QTBUG-5050
+ // This is a hack to prevent crashing in 4.6 with QLineEdits that use input masks.
+ // The root problem is that cursor position is relative to displayed text instead of the
+ // actual text we get.
+ //
+ // To properly fix this we would need to know the displayText of QLineEdits instead
+ // of just the text, which on itself should be a trivial change. The difficulties start
+ // when we need to commit the changes back to the QLineEdit, which would have to be somehow
+ // able to handle displayText, too.
+ //
+ // Until properly fixed, the cursor and anchor positions will not reflect correct positions
+ // for masked QLineEdits, unless all the masked positions are filled in order so that
+ // cursor position relative to the displayed text matches position relative to actual text.
+ aCursorSelection.iAnchorPos = combinedSize;
+ aCursorSelection.iCursorPos = combinedSize;
+ } else {
+ aCursorSelection.iAnchorPos = anchor;
+ aCursorSelection.iCursorPos = cursor;
+ }
+ } QT_CATCH(const std::exception&) {
+ aCursorSelection.SetSelection(0,0);
}
}
@@ -1618,6 +1631,12 @@ void QCoeFepInputContext::GetFormatForFep(TCharFormat& aFormat, TInt /* aDocumen
}
void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine, TInt& aHeight,
+ TInt& aAscent, TInt aDocumentPosition) const
+{
+ QT_TRYCATCH_LEAVING(getScreenCoordinatesForFepX(aLeftSideOfBaseLine, aHeight, aAscent, aDocumentPosition));
+}
+
+void QCoeFepInputContext::getScreenCoordinatesForFepX(TPoint& aLeftSideOfBaseLine, TInt& aHeight,
TInt& aAscent, TInt /* aDocumentPosition */) const
{
QWidget *w = focusWidget();
@@ -1774,36 +1793,40 @@ TBool QCoeFepInputContext::CcpuIsFocused() const
TBool QCoeFepInputContext::CcpuCanCut() const
{
- bool retval = false;
- if (m_inDestruction)
- return retval;
- QWidget *w = focusWidget();
- QObject *focusObject = 0;
- if (!w) {
- w = m_lastFocusedEditor;
- focusObject = m_lastFocusedObject;
- } else {
- w = getQWidgetFromQGraphicsView(w, &focusObject);
- }
- if (w) {
- QRect microFocus = w->inputMethodQuery(Qt::ImMicroFocus).toRect();
- if (microFocus.isNull()) {
- // For some reason, the editor does not have microfocus. Most probably,
- // it is due to using native fullscreen editing mode with QML apps.
- // Try accessing "selectedText" directly.
- QObject *invokeTarget = w;
- if (focusObject)
- invokeTarget = focusObject;
-
- QString selectedText = invokeTarget->property("selectedText").toString();
- retval = !selectedText.isNull();
+ QT_TRY {
+ bool retval = false;
+ if (m_inDestruction)
+ return retval;
+ QWidget *w = focusWidget();
+ QObject *focusObject = 0;
+ if (!w) {
+ w = m_lastFocusedEditor;
+ focusObject = m_lastFocusedObject;
} else {
- int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
- int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt();
- retval = cursor != anchor;
+ w = getQWidgetFromQGraphicsView(w, &focusObject);
}
+ if (w) {
+ QRect microFocus = w->inputMethodQuery(Qt::ImMicroFocus).toRect();
+ if (microFocus.isNull()) {
+ // For some reason, the editor does not have microfocus. Most probably,
+ // it is due to using native fullscreen editing mode with QML apps.
+ // Try accessing "selectedText" directly.
+ QObject *invokeTarget = w;
+ if (focusObject)
+ invokeTarget = focusObject;
+
+ QString selectedText = invokeTarget->property("selectedText").toString();
+ retval = !selectedText.isNull();
+ } else {
+ int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
+ int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt();
+ retval = cursor != anchor;
+ }
+ }
+ return retval;
+ } QT_CATCH(const std::exception&) {
+ return EFalse;
}
- return retval;
}
void QCoeFepInputContext::CcpuCutL()
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index fe239f5..bb84491 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1534,53 +1534,57 @@ bool QSymbianControl::hasFocusedAndVisibleChild(QWidget *parentWidget)
void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
{
- if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
- return;
+ QT_TRY {
+ if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
+ return;
#ifdef Q_WS_S60
- if (S60->splitViewLastWidget)
- return;
+ if (S60->splitViewLastWidget)
+ return;
#endif
- // Popups never get focused, but still receive the FocusChanged when they are hidden.
- if (QApplicationPrivate::popupWidgets != 0
- || (qwidget->windowType() & Qt::Popup) == Qt::Popup)
- return;
-
- if (IsFocused() && IsVisible()) {
- if (m_symbianPopupIsOpen) {
- QWidget *fw = QApplication::focusWidget();
- if (fw) {
- QFocusEvent event(QEvent::FocusIn, Qt::PopupFocusReason);
- QCoreApplication::sendEvent(fw, &event);
- }
- m_symbianPopupIsOpen = false;
- }
+ // Popups never get focused, but still receive the FocusChanged when they are hidden.
+ if (QApplicationPrivate::popupWidgets != 0
+ || (qwidget->windowType() & Qt::Popup) == Qt::Popup)
+ return;
- QApplication::setActiveWindow(qwidget->window());
- qwidget->d_func()->setWindowIcon_sys(true);
- qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle());
-#ifdef Q_WS_S60
- if (qwidget->isWindow())
- S60->setRecursiveDecorationsVisibility(qwidget, qwidget->windowState());
-#endif
- } else {
- QWidget *parentWindow = qwidget->window();
- if (QApplication::activeWindow() == parentWindow && !hasFocusedAndVisibleChild(parentWindow)) {
- if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) {
+ if (IsFocused() && IsVisible()) {
+ if (m_symbianPopupIsOpen) {
QWidget *fw = QApplication::focusWidget();
if (fw) {
- QFocusEvent event(QEvent::FocusOut, Qt::PopupFocusReason);
+ QFocusEvent event(QEvent::FocusIn, Qt::PopupFocusReason);
QCoreApplication::sendEvent(fw, &event);
}
- m_symbianPopupIsOpen = true;
- return;
+ m_symbianPopupIsOpen = false;
}
- QApplication::setActiveWindow(0);
+ QApplication::setActiveWindow(qwidget->window());
+ qwidget->d_func()->setWindowIcon_sys(true);
+ qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle());
+#ifdef Q_WS_S60
+ if (qwidget->isWindow())
+ S60->setRecursiveDecorationsVisibility(qwidget, qwidget->windowState());
+#endif
+ } else {
+ QWidget *parentWindow = qwidget->window();
+ if (QApplication::activeWindow() == parentWindow && !hasFocusedAndVisibleChild(parentWindow)) {
+ if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) {
+ QWidget *fw = QApplication::focusWidget();
+ if (fw) {
+ QFocusEvent event(QEvent::FocusOut, Qt::PopupFocusReason);
+ QCoreApplication::sendEvent(fw, &event);
+ }
+ m_symbianPopupIsOpen = true;
+ return;
+ }
+
+ QApplication::setActiveWindow(0);
+ }
}
+ // else { We don't touch the active window unless we were explicitly activated or deactivated }
+ } QT_CATCH(const std::exception&) {
+ // ignore errors
}
- // else { We don't touch the active window unless we were explicitly activated or deactivated }
}
void QSymbianControl::handleClientAreaChange()
@@ -2377,19 +2381,25 @@ int QApplication::symbianProcessEvent(const QSymbianEvent *event)
QScopedLoopLevelCounter counter(d->threadData);
- if (d->eventDispatcher->filterEvent(const_cast<QSymbianEvent *>(event)))
- return 1;
+ QT_TRY {
+ if (d->eventDispatcher->filterEvent(const_cast<QSymbianEvent *>(event)))
+ return 1;
+
+ QWidget *w = qApp ? qApp->focusWidget() : 0;
+ if (w) {
+ QInputContext *ic = w->inputContext();
+ if (ic && ic->symbianFilterEvent(w, event))
+ return 1;
+ }
- QWidget *w = qApp ? qApp->focusWidget() : 0;
- if (w) {
- QInputContext *ic = w->inputContext();
- if (ic && ic->symbianFilterEvent(w, event))
+ if (symbianEventFilter(event))
return 1;
+ } QT_CATCH(const std::exception& ex) {
+ // don't allow an exception to stop exit command handling
+ if (event->type() != QSymbianEvent::CommandEvent || event->command() != EEikCmdExit)
+ QT_RETHROW;
}
- if (symbianEventFilter(event))
- return 1;
-
switch (event->type()) {
case QSymbianEvent::WindowServerEvent:
return d->symbianProcessWsEvent(event);
diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp
index f5314bd..dc812fb 100644
--- a/src/gui/kernel/qclipboard_s60.cpp
+++ b/src/gui/kernel/qclipboard_s60.cpp
@@ -187,6 +187,7 @@ void readSymbianStoreLX(QMimeData* aData, CClipboard* clipboard)
QString string = qt_TDesC2QString(buf);
CleanupStack::PopAndDestroy(text);
+ aData->clear();
aData->setText(string);
}
@@ -196,6 +197,8 @@ void readFromStreamLX(QMimeData* aData,RReadStream& aStream)
// dependencies between cleanup styles, and no cleanup stack dependencies on stacked objects.
TCardinality mimeTypeCount;
aStream >> mimeTypeCount;
+ if (mimeTypeCount > 0)
+ aData->clear();
for (int i = 0; i< mimeTypeCount;i++)
{
// mime type
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index f99cc2c..52e3046 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1336,40 +1336,12 @@ QPoint QWidgetPrivate::mapFromGlobal(const QPoint &pos) const
QPoint QWidget::mapToGlobal(const QPoint &pos) const
{
Q_D(const QWidget);
- QPoint offset = data->crect.topLeft();
- const QWidget *w = this;
- const QWidget *p = w->parentWidget();
- while (!w->isWindow() && p) {
- w = p;
- p = p->parentWidget();
- offset += w->data->crect.topLeft();
- }
-
- const QWidgetPrivate *wd = w->d_func();
- QTLWExtra *tlw = wd->topData();
- if (!tlw->embedded)
- return pos + offset;
-
return d->mapToGlobal(pos);
}
QPoint QWidget::mapFromGlobal(const QPoint &pos) const
{
Q_D(const QWidget);
- QPoint offset = data->crect.topLeft();
- const QWidget *w = this;
- const QWidget *p = w->parentWidget();
- while (!w->isWindow() && p) {
- w = p;
- p = p->parentWidget();
- offset += w->data->crect.topLeft();
- }
-
- const QWidgetPrivate *wd = w->d_func();
- QTLWExtra *tlw = wd->topData();
- if (!tlw->embedded)
- return pos - offset;
-
return d->mapFromGlobal(pos);
}
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 27b1bf2..d4f904b 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -200,10 +200,12 @@ symbian {
SOURCES += \
painting/qpaintengine_raster_symbian.cpp \
painting/qregion_s60.cpp \
- painting/qcolormap_s60.cpp
+ painting/qcolormap_s60.cpp \
+ painting/qgraphicssystemhelper_symbian.cpp
HEADERS += \
- painting/qpaintengine_raster_symbian_p.h
+ painting/qpaintengine_raster_symbian_p.h \
+ painting/qgraphicssystemhelper_symbian.h
}
x11|embedded|qpa {
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 6fbb59f..d79be41 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -1625,7 +1625,7 @@ void QWidgetPrivate::repaint_sys(const QRegion &rgn)
extra->staticContentsSize = data.crect.size();
}
-#ifdef Q_WS_QPA //Dont even call q->p
+#ifdef Q_WS_QPA //Don't even call q->p
QPaintEngine *engine = 0;
#else
QPaintEngine *engine = q->paintEngine();
diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp
index 5a182ff..5bfd5a8 100644
--- a/src/gui/painting/qgraphicssystemex_symbian.cpp
+++ b/src/gui/painting/qgraphicssystemex_symbian.cpp
@@ -74,7 +74,7 @@ bool QSymbianGraphicsSystemEx::hasBCM2727()
#if 1
// Hacky but fast ~0ms.
const char* vendor = eglQueryString(display, EGL_VENDOR);
- if (strstr(vendor, "Broadcom")) {
+ if (vendor && strstr(vendor, "Broadcom")) {
const TUid KIvePropertyCat = {0x2726beef};
enum TIvePropertyChipType {
EVCBCM2727B1 = 0x00000000,
diff --git a/src/gui/painting/qgraphicssystemhelper_symbian.cpp b/src/gui/painting/qgraphicssystemhelper_symbian.cpp
new file mode 100644
index 0000000..eb70247
--- /dev/null
+++ b/src/gui/painting/qgraphicssystemhelper_symbian.cpp
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qgraphicssystemhelper_symbian.h"
+#include "qt_s60_p.h"
+#include "qwidget_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \enum QSymbianGraphicsSystemHelper::NativePaintMode
+
+ This enum controls the way in which QWidget paints content from the Qt
+ backing store into the corresponding native window surface.
+
+ \value NativePaintModeDefault Default painting behaviour.
+ \value NativePaintModeZeroFill Ignore contents of backing store, and
+ fill the window surface region with zeroes.
+ \value NativePaintModeWriteAlpha By default, alpha values are only copied
+ from the backing store into the window surface if the top-level widget
+ has the Qt::WA_TranslucentBackground attribute. If this mode is set,
+ alpha values are copied regardless of the value of that attribute.
+ \value NativePaintModeDisable Do not paint anything into the native window
+ surface.
+ */
+
+/*!
+ \class QSymbianGraphicsSystemHelper
+ \ingroup painting
+
+ \brief QSymbianGraphicsSystemHelper defines functions required by
+ QtMultimediaKit in order to enable video rendering.
+
+ This class is not intended for use by applications.
+*/
+
+/*!
+ Specify whether native focus change events should be ignored by the widget.
+*/
+
+void QSymbianGraphicsSystemHelper::setIgnoreFocusChanged(QWidget *widget, bool value)
+{
+ static_cast<QSymbianControl *>(widget->winId())->setIgnoreFocusChanged(value);
+}
+
+/*!
+ Set the native paint mode to the specified \a mode.
+*/
+
+void QSymbianGraphicsSystemHelper::setNativePaintMode(QWidget *widget, NativePaintMode mode)
+{
+ QWidgetPrivate *widgetPrivate = qt_widget_private(widget->window());
+ widgetPrivate->createExtra();
+ QWExtra::NativePaintMode widgetMode = QWExtra::Default;
+ switch (mode) {
+ case NativePaintModeDefault:
+ break;
+ case NativePaintModeZeroFill:
+ widgetMode = QWExtra::ZeroFill;
+ break;
+ case NativePaintModeWriteAlpha:
+ widgetMode = QWExtra::BlitWriteAlpha;
+ break;
+ case NativePaintModeDisable:
+ widgetMode = QWExtra::Disable;
+ break;
+ }
+ widgetPrivate->extraData()->nativePaintMode = widgetMode;
+}
+
+/*!
+ Set the native paint mode to the specified \a mode.
+*/
+
+void QSymbianGraphicsSystemHelper::setNativePaintMode(WId wid, NativePaintMode mode)
+{
+ QWidget *window = static_cast<QSymbianControl *>(wid)->widget()->window();
+ setNativePaintMode(window, mode);
+}
+
+/*!
+ Specify whether the widget should receive receive native paint events.
+
+ If enabled, the QWidget::beginNativePaintEvent slot is called before
+ content from the backing store is written into the native window
+ surface, and QWidget::endNativePaintEvent is called once writing to
+ the native window surface is complete.
+
+ This function is intended for use by QWidget clients such as video
+ widgets, which wish to use Direct Screen Access to write into the
+ native window surface. Such clients should stop their DSA session on
+ receipt of QWidget::beginNativePaintEvent, and re-start it on receipt of
+ QWidget::endNativePaintEvent.
+*/
+
+void QSymbianGraphicsSystemHelper::setReceiveNativePaintEvents(QWidget *widget, bool value)
+{
+ QWidgetPrivate *widgetPrivate = qt_widget_private(widget);
+ widgetPrivate->createExtra();
+ widgetPrivate->extraData()->receiveNativePaintEvents = value;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystemhelper_symbian.h b/src/gui/painting/qgraphicssystemhelper_symbian.h
new file mode 100644
index 0000000..b74144e
--- /dev/null
+++ b/src/gui/painting/qgraphicssystemhelper_symbian.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSYMBIANGRAPHICSSYSTEMHELPER_H
+#define QSYMBIANGRAPHICSSYSTEMHELPER_H
+
+#include <QtCore/qglobal.h>
+
+#ifndef Q_OS_SYMBIAN
+#error "This header file can only be included when building for Symbian"
+#endif
+
+#include <QtGui/qwindowdefs.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QWidget;
+
+class Q_GUI_EXPORT QSymbianGraphicsSystemHelper
+{
+public:
+ enum NativePaintMode {
+ NativePaintModeDefault,
+ NativePaintModeZeroFill,
+ NativePaintModeWriteAlpha,
+ NativePaintModeDisable
+ };
+
+ static void setIgnoreFocusChanged(QWidget *widget, bool value);
+ static void setNativePaintMode(QWidget *widget, NativePaintMode mode);
+ static void setNativePaintMode(WId wid, NativePaintMode mode);
+ static void setReceiveNativePaintEvents(QWidget *widget, bool value);
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QSYMBIANGRAPHICSSYSTEMHELPER_H
+
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 8f0e602..4d6252f 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -4552,6 +4552,107 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
rect.setTop(rect.top() + SIZE(6 /* AHIG */, 3 /* guess */, 2 /* AHIG */));
}
break;
+#ifndef QT_NO_DOCKWIDGET
+ case SE_DockWidgetCloseButton:
+ case SE_DockWidgetFloatButton:
+ case SE_DockWidgetTitleBarText:
+ case SE_DockWidgetIcon: {
+ int iconSize = proxy()->pixelMetric(PM_SmallIconSize, opt, widget);
+ int buttonMargin = proxy()->pixelMetric(PM_DockWidgetTitleBarButtonMargin, opt, widget);
+ QRect srect = opt->rect;
+
+ const QStyleOptionDockWidget *dwOpt
+ = qstyleoption_cast<const QStyleOptionDockWidget*>(opt);
+ bool canClose = dwOpt == 0 ? true : dwOpt->closable;
+ bool canFloat = dwOpt == 0 ? false : dwOpt->floatable;
+ const QStyleOptionDockWidgetV2 *v2
+ = qstyleoption_cast<const QStyleOptionDockWidgetV2*>(opt);
+ bool verticalTitleBar = v2 == 0 ? false : v2->verticalTitleBar;
+
+ // If this is a vertical titlebar, we transpose and work as if it was
+ // horizontal, then transpose again.
+ if (verticalTitleBar) {
+ QSize size = srect.size();
+ size.transpose();
+ srect.setSize(size);
+ }
+
+ do {
+ int right = srect.right();
+ int left = srect.left();
+
+ QRect closeRect;
+ if (canClose) {
+ QSize sz = standardIcon(QStyle::SP_TitleBarCloseButton,
+ opt, widget).actualSize(QSize(iconSize, iconSize));
+ sz += QSize(buttonMargin, buttonMargin);
+ if (verticalTitleBar)
+ sz.transpose();
+ closeRect = QRect(left,
+ srect.center().y() - sz.height()/2,
+ sz.width(), sz.height());
+ left = closeRect.right() + 1;
+ }
+ if (sr == SE_DockWidgetCloseButton) {
+ rect = closeRect;
+ break;
+ }
+
+ QRect floatRect;
+ if (canFloat) {
+ QSize sz = standardIcon(QStyle::SP_TitleBarNormalButton,
+ opt, widget).actualSize(QSize(iconSize, iconSize));
+ sz += QSize(buttonMargin, buttonMargin);
+ if (verticalTitleBar)
+ sz.transpose();
+ floatRect = QRect(left,
+ srect.center().y() - sz.height()/2,
+ sz.width(), sz.height());
+ left = floatRect.right() + 1;
+ }
+ if (sr == SE_DockWidgetFloatButton) {
+ rect = floatRect;
+ break;
+ }
+
+ QRect iconRect;
+ if (const QDockWidget *dw = qobject_cast<const QDockWidget*>(widget)) {
+ QIcon icon;
+ if (dw->isFloating())
+ icon = dw->windowIcon();
+ if (!icon.isNull()
+ && icon.cacheKey() != QApplication::windowIcon().cacheKey()) {
+ QSize sz = icon.actualSize(QSize(rect.height(), rect.height()));
+ if (verticalTitleBar)
+ sz.transpose();
+ iconRect = QRect(right - sz.width(), srect.center().y() - sz.height()/2,
+ sz.width(), sz.height());
+ right = iconRect.left() - 1;
+ }
+ }
+ if (sr == SE_DockWidgetIcon) {
+ rect = iconRect;
+ break;
+ }
+
+ QRect textRect = QRect(left, srect.top(),
+ right - left, srect.height());
+ if (sr == SE_DockWidgetTitleBarText) {
+ rect = textRect;
+ break;
+ }
+ } while (false);
+
+ if (verticalTitleBar) {
+ rect = QRect(srect.left() + rect.top() - srect.top(),
+ srect.top() + srect.right() - rect.right(),
+ rect.height(), rect.width());
+ } else {
+ rect = visualRect(opt->direction, srect, rect);
+ }
+ break;
+ }
+#endif
default:
rect = QWindowsStyle::subElementRect(sr, opt, widget);
break;
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index 5525468..8051014 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -2508,6 +2508,7 @@ QWindowsVistaStylePrivate::QWindowsVistaStylePrivate() :
QWindowsVistaStylePrivate::~QWindowsVistaStylePrivate()
{
+ qDeleteAll(animations);
delete m_treeViewHelper;
}
diff --git a/src/imports/shaders/shadereffect.cpp b/src/imports/shaders/shadereffect.cpp
index f40d6b8..a5164e2 100644
--- a/src/imports/shaders/shadereffect.cpp
+++ b/src/imports/shaders/shadereffect.cpp
@@ -61,6 +61,7 @@ ShaderEffect::~ShaderEffect()
void ShaderEffect::prepareBufferedDraw(QPainter *painter)
{
+#ifndef QT_NO_DYNAMIC_CAST
// This workaround needed because QGraphicsEffect seems to always utilize default painters worldtransform
// instead of the active painters worldtransform.
const ShaderEffectBuffer *effectBuffer = dynamic_cast<ShaderEffectBuffer*> (painter->device());
@@ -70,6 +71,9 @@ void ShaderEffect::prepareBufferedDraw(QPainter *painter)
} else {
savedWorldTransform = painter->worldTransform();
}
+#else
+ Q_UNUSED(painter);
+#endif
}
void ShaderEffect::draw (QPainter *painter)
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 15fda34..b9db7fe 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -788,6 +788,7 @@ void QHttpNetworkConnectionChannel::detectPipeliningSupport()
&& (!serverHeaderField.contains("Netscape-Enterprise/3."))
// this is adpoted from the knowledge of the Nokia 7.x browser team (DEF143319)
&& (!serverHeaderField.contains("WebLogic"))
+ && (!serverHeaderField.startsWith("Rocket")) // a Python Web Server, see Web2py.com
) {
pipeliningSupported = QHttpNetworkConnectionChannel::PipeliningProbablySupported;
} else {
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 71d61a4..4167b6d 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -1384,9 +1384,9 @@ void QNetworkProxyFactory::setApplicationProxyFactory(QNetworkProxyFactory *fact
SOCKS server for all queries. If SOCKS isn't enabled, it will use
the HTTPS proxy for all TcpSocket and UrlRequest queries.
- On other systems, there is no standardised method of obtaining the
- system proxy configuration. This function may be improved in
- future versions to support those systems.
+ On other systems, this function will pick up proxy settings from
+ the "http_proxy" environment variable. This variable must be a URL
+ using one of the following schemes: "http", "socks5" or "socks5h".
\section1 Limitations
diff --git a/src/network/kernel/qnetworkproxy_generic.cpp b/src/network/kernel/qnetworkproxy_generic.cpp
index e9eaee9..f78f63d 100644
--- a/src/network/kernel/qnetworkproxy_generic.cpp
+++ b/src/network/kernel/qnetworkproxy_generic.cpp
@@ -41,17 +41,44 @@
#include "qnetworkproxy.h"
+#include <QtCore/QByteArray>
+#include <QtCore/QUrl>
+
#ifndef QT_NO_NETWORKPROXY
/*
- * No system proxy. Just return a list with NoProxy.
+ * Construct a proxy from the environment variable http_proxy.
+ * Or no system proxy. Just return a list with NoProxy.
*/
QT_BEGIN_NAMESPACE
QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkProxyQuery &)
{
- return QList<QNetworkProxy>() << QNetworkProxy::NoProxy;
+ QList<QNetworkProxy> proxyList;
+
+ QByteArray proxy_env = qgetenv("http_proxy");
+ if (!proxy_env.isEmpty()) {
+ QUrl url = QUrl(QString::fromLocal8Bit(proxy_env));
+ if (url.scheme() == QLatin1String("socks5")) {
+ QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, url.host(),
+ url.port() ? url.port() : 1080, url.userName(), url.password());
+ proxyList << proxy;
+ } else if (url.scheme() == QLatin1String("socks5h")) {
+ QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, url.host(),
+ url.port() ? url.port() : 1080, url.userName(), url.password());
+ proxy.setCapabilities(QNetworkProxy::HostNameLookupCapability);
+ proxyList << proxy;
+ } else if (url.scheme() == QLatin1String("http") || url.scheme().isEmpty()) {
+ QNetworkProxy proxy(QNetworkProxy::HttpProxy, url.host(),
+ url.port() ? url.port() : 8080, url.userName(), url.password());
+ proxyList << proxy;
+ }
+ }
+ if (proxyList.isEmpty())
+ proxyList << QNetworkProxy::NoProxy;
+
+ return proxyList;
}
QT_END_NAMESPACE
diff --git a/src/network/socket/qlocalserver_unix.cpp b/src/network/socket/qlocalserver_unix.cpp
index 851e898..390712c 100644
--- a/src/network/socket/qlocalserver_unix.cpp
+++ b/src/network/socket/qlocalserver_unix.cpp
@@ -167,16 +167,16 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName)
*/
void QLocalServerPrivate::closeServer()
{
- if (-1 != listenSocket)
- QT_CLOSE(listenSocket);
- listenSocket = -1;
-
if (socketNotifier) {
socketNotifier->setEnabled(false); // Otherwise, closed socket is checked before deleter runs
socketNotifier->deleteLater();
socketNotifier = 0;
}
+ if (-1 != listenSocket)
+ QT_CLOSE(listenSocket);
+ listenSocket = -1;
+
if (!fullServerName.isEmpty())
QFile::remove(fullServerName);
}
diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp
index b556328..01297c9 100644
--- a/src/network/ssl/qssl.cpp
+++ b/src/network/ssl/qssl.cpp
@@ -141,9 +141,15 @@ QT_BEGIN_NAMESPACE
\value SslOptionDisableServerNameIndication Disables the SSL server
name indication extension. When enabled, this tells the server the virtual
host being accessed allowing it to respond with the correct certificate.
+ \value SslOptionDisableLegacyRenegotiation Disables the older insecure
+ mechanism for renegotiating the connection parameters. When enabled, this
+ option can allow connections for legacy servers, but it introduces the
+ possibility that an attacker could inject plaintext into the SSL session.
By default, SslOptionDisableEmptyFragments is turned on since this causes
- problems with a large number of servers, but the other options are disabled.
+ problems with a large number of servers. SslOptionDisableLegacyRenegotiation
+ is also turned on, since it introduces a security risk. The other options
+ are turned off.
Note: Availability of above options depends on the version of the SSL
backend in use.
diff --git a/src/network/ssl/qssl.h b/src/network/ssl/qssl.h
index 453d4da..571aa1f 100644
--- a/src/network/ssl/qssl.h
+++ b/src/network/ssl/qssl.h
@@ -87,7 +87,8 @@ namespace QSsl {
SslOptionDisableEmptyFragments = 0x01,
SslOptionDisableSessionTickets = 0x02,
SslOptionDisableCompression = 0x04,
- SslOptionDisableServerNameIndication = 0x08
+ SslOptionDisableServerNameIndication = 0x08,
+ SslOptionDisableLegacyRenegotiation = 0x10
};
Q_DECLARE_FLAGS(SslOptions, SslOption)
}
diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp
index e24076e..727130b 100644
--- a/src/network/ssl/qsslconfiguration.cpp
+++ b/src/network/ssl/qsslconfiguration.cpp
@@ -201,7 +201,7 @@ bool QSslConfiguration::isNull() const
d->privateKey.isNull() &&
d->peerCertificate.isNull() &&
d->peerCertificateChain.count() == 0 &&
- d->sslOptions == 0);
+ d->sslOptions == QSsl::SslOptionDisableEmptyFragments|QSsl::SslOptionDisableLegacyRenegotiation);
}
/*!
diff --git a/src/network/ssl/qsslconfiguration_p.h b/src/network/ssl/qsslconfiguration_p.h
index b83edb9..a711eeb 100644
--- a/src/network/ssl/qsslconfiguration_p.h
+++ b/src/network/ssl/qsslconfiguration_p.h
@@ -82,7 +82,8 @@ public:
QSslConfigurationPrivate()
: protocol(QSsl::SecureProtocols),
peerVerifyMode(QSslSocket::AutoVerifyPeer),
- peerVerifyDepth(0)
+ peerVerifyDepth(0),
+ sslOptions(QSsl::SslOptionDisableEmptyFragments|QSsl::SslOptionDisableLegacyRenegotiation)
{ }
QSslCertificate peerCertificate;
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 3942209..5f520f7 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -298,6 +298,14 @@ init_context:
else
options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
+#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
+ // This option is disabled by default, so we need to be able to clear it
+ if (configuration.sslOptions & QSsl::SslOptionDisableLegacyRenegotiation)
+ options &= ~SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION;
+ else
+ options |= SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION;
+#endif
+
#ifdef SSL_OP_NO_TICKET
if (configuration.sslOptions & QSsl::SslOptionDisableSessionTickets)
options |= SSL_OP_NO_TICKET;
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index 518c860..b31833a 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -404,7 +404,7 @@ QGLContext *QGLContext::fromPlatformGLContext(QPlatformGLContext *platformContex
return reinterpret_cast<QGLContext *>(platformContext->qGLContextHandle());
}
QGLContext *glContext = new QGLContext(platformContext);
- //Dont call create on context. This can cause the platformFormat to be set on the widget, which
+ //Don't call create on context. This can cause the platformFormat to be set on the widget, which
//will cause the platformWindow to be recreated.
return glContext;
}
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index e963f8c..a15084b 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -362,7 +362,7 @@ QGLWindowSurface::~QGLWindowSurface()
{
if (d_ptr->ctx)
glDeleteTextures(1, &d_ptr->tex_id);
-#ifndef Q_WS_QPA // Dont delete the contexts. Destroying the window does that for us
+#ifndef Q_WS_QPA // Don't delete the contexts. Destroying the window does that for us
foreach(QGLContext **ctx, d_ptr->contexts) {
delete *ctx;
*ctx = 0;
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index a7dad2b..f5f71cf 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -97,7 +97,6 @@ void QNetworkSessionPrivateImpl::closeHandles()
QSymbianSocketManager::instance().setDefaultConnection(0);
- iConnectionMonitor.Close();
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
qDebug() << "QNS this : " << QString::number((uint)this)
<< " - handles closed";
@@ -111,6 +110,7 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
isOpening = false;
closeHandles();
+ iConnectionMonitor.Close();
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
qDebug() << "QNS this : " << QString::number((uint)this)
<< " - destroyed";
diff --git a/src/plugins/imageformats/imageformats.pro b/src/plugins/imageformats/imageformats.pro
index 5fff2de..54a2795 100644
--- a/src/plugins/imageformats/imageformats.pro
+++ b/src/plugins/imageformats/imageformats.pro
@@ -6,3 +6,4 @@ TEMPLATE = subdirs
contains(QT_CONFIG, svg):SUBDIRS += svg
!contains(QT_CONFIG, no-tiff):!contains(QT_CONFIG, tiff):SUBDIRS += tiff
!contains(QT_CONFIG, no-ico):SUBDIRS += ico
+!contains(QT_CONFIG, no-tga):SUBDIRS += tga
diff --git a/src/plugins/imageformats/tga/main.cpp b/src/plugins/imageformats/tga/main.cpp
new file mode 100644
index 0000000..5650be2
--- /dev/null
+++ b/src/plugins/imageformats/tga/main.cpp
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtQuick3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QImageIOHandler>
+#include <QtCore/QDebug>
+
+#ifndef QT_NO_IMAGEFORMATPLUGIN
+
+#ifdef QT_NO_IMAGEFORMAT_TGA
+#undef QT_NO_IMAGEFORMAT_TGA
+#endif
+
+#include "qtgahandler.h"
+
+QT_BEGIN_NAMESPACE
+
+class QTgaPlugin : public QImageIOPlugin
+{
+public:
+ Capabilities capabilities(QIODevice * device, const QByteArray & format) const;
+ QImageIOHandler * create(QIODevice * device, const QByteArray & format = QByteArray()) const;
+ QStringList keys() const;
+};
+
+QImageIOPlugin::Capabilities QTgaPlugin::capabilities(QIODevice *device, const QByteArray &format) const
+{
+ if (format == "tga")
+ return Capabilities(CanRead);
+ if (!format.isEmpty())
+ return 0;
+ if (!device->isOpen())
+ return 0;
+
+ Capabilities cap;
+ if (device->isReadable() && QTgaHandler::canRead(device))
+ cap |= CanRead;
+ return cap;
+}
+
+QImageIOHandler* QTgaPlugin::create(QIODevice *device, const QByteArray &format) const
+{
+ QImageIOHandler *tgaHandler = new QTgaHandler();
+ tgaHandler->setDevice(device);
+ tgaHandler->setFormat(format);
+ return tgaHandler;
+}
+
+QStringList QTgaPlugin::keys() const
+{
+ return QStringList() << QLatin1String("tga");
+}
+
+Q_EXPORT_PLUGIN2(qtga, QTgaPlugin)
+
+QT_END_NAMESPACE
+
+#endif /* QT_NO_IMAGEFORMATPLUGIN */
diff --git a/src/plugins/imageformats/tga/qtgafile.cpp b/src/plugins/imageformats/tga/qtgafile.cpp
new file mode 100644
index 0000000..885a63c
--- /dev/null
+++ b/src/plugins/imageformats/tga/qtgafile.cpp
@@ -0,0 +1,266 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtQuick3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtgafile.h"
+
+#include <QtCore/QIODevice>
+#include <QtCore/QDebug>
+#include <QtCore/QDateTime>
+
+struct TgaReader
+{
+ virtual ~TgaReader() {}
+ virtual QRgb operator()(QIODevice *s) const = 0;
+};
+
+struct Tga16Reader : public TgaReader
+{
+ ~Tga16Reader() {}
+ QRgb operator()(QIODevice *s) const
+ {
+ char ch1, ch2;
+ if (s->getChar(&ch1) && s->getChar(&ch2)) {
+ quint16 d = (int(ch1) & 0xFF) | ((int(ch2) & 0xFF) << 8);
+ QRgb result = (d & 0x8000) ? 0xFF000000 : 0x00000000;
+ result |= (d & 0x7C00 << 6) | (d & 0x03E0 << 3) | (d & 0x001F);
+ return result;
+ } else {
+ return 0;
+ }
+ }
+};
+
+struct Tga24Reader : public TgaReader
+{
+ QRgb operator()(QIODevice *s) const
+ {
+ char r, g, b;
+ if (s->getChar(&b) && s->getChar(&g) && s->getChar(&r))
+ return qRgb(uchar(r), uchar(g), uchar(b));
+ else
+ return 0;
+ }
+};
+
+struct Tga32Reader : public TgaReader
+{
+ QRgb operator()(QIODevice *s) const
+ {
+ char r, g, b, a;
+ if (s->getChar(&b) && s->getChar(&g) && s->getChar(&r) && s->getChar(&a))
+ return qRgba(uchar(r), uchar(g), uchar(b), uchar(a));
+ else
+ return 0;
+ }
+};
+
+/*!
+ \class QTgaFile
+ \since 4.8
+ \internal
+
+ File data container for a TrueVision Graphics format file.
+
+ Format is as described here:
+ http://local.wasp.uwa.edu.au/~pbourke/dataformats/tga/
+ http://netghost.narod.ru/gff2/graphics/summary/tga.htm
+
+ Usage is:
+ \code
+ QTgaFile tga(myFile);
+ QImage tgaImage;
+ if (tga.isValid())
+ tgaImage = tga.readImage();
+ \endcode
+
+ The class is designed to handle sequential and non-sequential
+ sources, so during construction the mHeader is read. Then during
+ the readImage() call the rest of the data is read.
+
+ After passing myFile to the constructor, if the QIODevice *myFile
+ is read, or has seek() called, the results are undefined - so don't
+ do that.
+*/
+
+/*!
+ Construct a new QTgaFile object getting data from \a device.
+
+ The object does not take ownership of the \a device, but until the
+ object is destroyed do not do any non-const operations, eg seek or
+ read on the device.
+*/
+QTgaFile::QTgaFile(QIODevice *device)
+ : mDevice(device)
+{
+ ::memset(mHeader, 0, HeaderSize);
+ if (!mDevice->isReadable())
+ {
+ mErrorMessage = QObject::tr("Could not read image data");
+ return;
+ }
+ if (mDevice->isSequential())
+ {
+ mErrorMessage = QObject::tr("Sequential device (eg socket) for image read not supported");
+ return;
+ }
+ if (!mDevice->seek(0))
+ {
+ mErrorMessage = QObject::tr("Seek file/device for image read failed");
+ return;
+ }
+ int bytes = device->read((char*)mHeader, HeaderSize);
+ if (bytes != HeaderSize)
+ {
+ mErrorMessage = QObject::tr("Image mHeader read failed");
+ return;
+ }
+ if (mHeader[ImageType] != 2)
+ {
+ // TODO: should support other image types
+ mErrorMessage = QObject::tr("Image type not supported");
+ return;
+ }
+ int bitsPerPixel = mHeader[PixelDepth];
+ bool validDepth = (bitsPerPixel == 16 || bitsPerPixel == 24 || bitsPerPixel == 32);
+ if (!validDepth)
+ {
+ mErrorMessage = QObject::tr("Image dpeth not valid");
+ }
+ int curPos = mDevice->pos();
+ int fileBytes = mDevice->size();
+ if (!mDevice->seek(fileBytes - FooterSize))
+ {
+ mErrorMessage = QObject::tr("Could not seek to image read footer");
+ return;
+ }
+ char footer[FooterSize];
+ bytes = mDevice->read((char*)footer, FooterSize);
+ if (bytes != FooterSize)
+ {
+ mErrorMessage = QObject::tr("Could not read footer");
+ }
+ if (qstrncmp(&footer[SignatureOffset], "TRUEVISION-XFILE", 16) != 0)
+ {
+ mErrorMessage = QObject::tr("Image type (non-TrueVision 2.0) not supported");
+ }
+ if (!mDevice->seek(curPos))
+ {
+ mErrorMessage = QObject::tr("Could not reset to read data");
+ }
+}
+
+/*!
+ \internal
+ Destroy the device, recovering any resources.
+*/
+QTgaFile::~QTgaFile()
+{
+}
+
+/*!
+ \internal
+ Reads an image file from the QTgaFile's device, and returns it.
+
+ This method seeks to the absolute position of the image data in the file,
+ so no assumptions are made about where the devices read pointer is when this
+ method is called. For this reason only random access devices are supported.
+
+ If the constructor completed successfully, such that isValid() returns true,
+ then this method is likely to succeed, unless the file is somehow corrupted.
+
+ In the case that the read fails, the QImage returned will be null, such that
+ QImage::isNull() will be true.
+*/
+QImage QTgaFile::readImage()
+{
+ if (!isValid())
+ return QImage();
+
+ int offset = mHeader[IdLength]; // Mostly always zero
+
+ // Even in TrueColor files a color pallette may be present
+ if (mHeader[ColorMapType] == 1)
+ offset += littleEndianInt(&mHeader[CMapLength]) * littleEndianInt(&mHeader[CMapDepth]);
+
+ mDevice->seek(HeaderSize + offset);
+
+ char dummy;
+ for (int i = 0; i < offset; ++i)
+ mDevice->getChar(&dummy);
+
+ int bitsPerPixel = mHeader[PixelDepth];
+ int imageWidth = width();
+ int imageHeight = height();
+
+ unsigned char desc = mHeader[ImageDescriptor];
+ //unsigned char xCorner = desc & 0x10; // 0 = left, 1 = right
+ unsigned char yCorner = desc & 0x20; // 0 = lower, 1 = upper
+
+ QImage im(imageWidth, imageHeight, QImage::Format_ARGB32);
+ TgaReader *reader = 0;
+ if (bitsPerPixel == 16)
+ reader = new Tga16Reader();
+ else if (bitsPerPixel == 24)
+ reader = new Tga24Reader();
+ else if (bitsPerPixel == 32)
+ reader = new Tga32Reader();
+ TgaReader &read = *reader;
+
+ // For now only deal with yCorner, since no one uses xCorner == 1
+ // Also this is upside down, since Qt has the origin flipped
+ if (yCorner)
+ {
+ for (int y = 0; y < imageHeight; ++y)
+ for (int x = 0; x < imageWidth; ++x)
+ im.setPixel(x, y, read(mDevice));
+ }
+ else
+ {
+ for (int y = imageHeight - 1; y >= 0; --y)
+ for (int x = 0; x < imageWidth; ++x)
+ im.setPixel(x, y, read(mDevice));
+ }
+
+ delete reader;
+
+ // TODO: add processing of TGA extension information - ie TGA 2.0 files
+ return im;
+}
diff --git a/src/plugins/imageformats/tga/qtgafile.h b/src/plugins/imageformats/tga/qtgafile.h
new file mode 100644
index 0000000..264c18b
--- /dev/null
+++ b/src/plugins/imageformats/tga/qtgafile.h
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtQuick3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTGAFILE_H
+#define QTGAFILE_H
+
+#include <QtGui/QColor>
+#include <QtGui/QImage>
+
+QT_BEGIN_NAMESPACE
+
+class QIODevice;
+
+class QTgaFile
+{
+public:
+ enum Compression {
+ NoCompression = 0,
+ RleCompression = 1
+ };
+
+ enum HeaderOffset {
+ IdLength = 0, /* 00h Size of Image ID field */
+ ColorMapType = 1, /* 01h Color map type */
+ ImageType = 2, /* 02h Image type code */
+ CMapStart = 3, /* 03h Color map origin */
+ CMapLength = 5, /* 05h Color map length */
+ CMapDepth = 7, /* 07h Depth of color map entries */
+ XOffset = 8, /* 08h X origin of image */
+ YOffset = 10, /* 0Ah Y origin of image */
+ Width = 12, /* 0Ch Width of image */
+ Height = 14, /* 0Eh Height of image */
+ PixelDepth = 16, /* 10h Image pixel size */
+ ImageDescriptor = 17, /* 11h Image descriptor byte */
+ HeaderSize = 18
+ };
+
+ enum FooterOffset {
+ ExtensionOffset = 0,
+ DeveloperOffset = 4,
+ SignatureOffset = 8,
+ FooterSize = 26
+ };
+
+ QTgaFile(QIODevice *);
+ ~QTgaFile();
+
+ inline bool isValid() const;
+ inline QString errorMessage() const;
+ QImage readImage();
+ inline int xOffset() const;
+ inline int yOffset() const;
+ inline int width() const;
+ inline int height() const;
+ inline QSize size() const;
+ inline Compression compression() const;
+
+private:
+ static inline quint16 littleEndianInt(const unsigned char *d);
+
+ QString mErrorMessage;
+ unsigned char mHeader[HeaderSize];
+ QIODevice *mDevice;
+};
+
+inline bool QTgaFile::isValid() const
+{
+ return mErrorMessage.isEmpty();
+}
+
+inline QString QTgaFile::errorMessage() const
+{
+ return mErrorMessage;
+}
+
+/*!
+ \internal
+ Returns the integer encoded in the two little endian bytes at \a d.
+*/
+inline quint16 QTgaFile::littleEndianInt(const unsigned char *d)
+{
+ return d[0] + d[1] * 256;
+}
+
+inline int QTgaFile::xOffset() const
+{
+ return littleEndianInt(&mHeader[XOffset]);
+}
+
+inline int QTgaFile::yOffset() const
+{
+ return littleEndianInt(&mHeader[YOffset]);
+}
+
+inline int QTgaFile::width() const
+{
+ return littleEndianInt(&mHeader[Width]);
+}
+
+inline int QTgaFile::height() const
+{
+ return littleEndianInt(&mHeader[Height]);
+}
+
+inline QSize QTgaFile::size() const
+{
+ return QSize(width(), height());
+}
+
+inline QTgaFile::Compression QTgaFile::compression() const
+{
+ // TODO: for now, only handle type 2 files, with no color table
+ // and no compression
+ return NoCompression;
+}
+
+QT_END_NAMESPACE
+
+#endif // QTGAFILE_H
diff --git a/src/plugins/imageformats/tga/qtgahandler.cpp b/src/plugins/imageformats/tga/qtgahandler.cpp
new file mode 100644
index 0000000..ddea4f2
--- /dev/null
+++ b/src/plugins/imageformats/tga/qtgahandler.cpp
@@ -0,0 +1,122 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtQuick3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtgahandler.h"
+#include "qtgafile.h"
+
+#include <QtCore/QVariant>
+#include <QtCore/QDebug>
+#include <QtGui/QImage>
+
+QT_BEGIN_NAMESPACE
+
+QTgaHandler::QTgaHandler()
+ : QImageIOHandler()
+ , tga(0)
+{
+}
+
+QTgaHandler::~QTgaHandler()
+{
+ delete tga;
+}
+
+bool QTgaHandler::canRead() const
+{
+ if (!tga)
+ tga = new QTgaFile(device());
+ if (tga->isValid())
+ {
+ setFormat("tga");
+ return true;
+ }
+ return false;
+}
+
+bool QTgaHandler::canRead(QIODevice *device)
+{
+ if (!device) {
+ qWarning("QTgaHandler::canRead() called with no device");
+ return false;
+ }
+ QTgaFile tga(device);
+ return tga.isValid();
+}
+
+bool QTgaHandler::read(QImage *image)
+{
+ if (!canRead())
+ return false;
+ *image = tga->readImage();
+ return !image->isNull();
+}
+
+QByteArray QTgaHandler::name() const
+{
+ return "tga";
+}
+
+QVariant QTgaHandler::option(ImageOption option) const
+{
+ if (option == Size && canRead()) {
+ return tga->size();
+ } else if (option == CompressionRatio) {
+ return tga->compression();
+ } else if (option == ImageFormat) {
+ return QImage::Format_ARGB32;
+ }
+ return QVariant();
+}
+
+void QTgaHandler::setOption(ImageOption option, const QVariant &value)
+{
+ Q_UNUSED(option);
+ Q_UNUSED(value);
+}
+
+bool QTgaHandler::supportsOption(ImageOption option) const
+{
+ return option == CompressionRatio
+ || option == Size
+ || option == ImageFormat;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/imageformats/tga/qtgahandler.h b/src/plugins/imageformats/tga/qtgahandler.h
new file mode 100644
index 0000000..f0eb2b0
--- /dev/null
+++ b/src/plugins/imageformats/tga/qtgahandler.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtQuick3D module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTGAHANDLER_H
+#define QTGAHANDLER_H
+
+#include <QtGui/QImageIOHandler>
+
+QT_BEGIN_NAMESPACE
+
+class QTgaFile;
+
+class QTgaHandler : public QImageIOHandler
+{
+public:
+ QTgaHandler();
+ ~QTgaHandler();
+
+ bool canRead() const;
+ bool read(QImage *image);
+
+ QByteArray name() const;
+
+ static bool canRead(QIODevice *device);
+
+ QVariant option(ImageOption option) const;
+ void setOption(ImageOption option, const QVariant &value);
+ bool supportsOption(ImageOption option) const;
+
+private:
+ mutable QTgaFile *tga;
+};
+
+QT_END_NAMESPACE
+
+#endif // QTGAHANDLER_H
diff --git a/src/plugins/imageformats/tga/tga.pro b/src/plugins/imageformats/tga/tga.pro
new file mode 100644
index 0000000..292d06e
--- /dev/null
+++ b/src/plugins/imageformats/tga/tga.pro
@@ -0,0 +1,16 @@
+TARGET = qtga
+include(../../qpluginbase.pri)
+
+QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-tga)"
+
+HEADERS += qtgahandler.h \
+ qtgafile.h
+SOURCES += main.cpp \
+ qtgahandler.cpp \
+ qtgafile.cpp
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/imageformats
+target.path += $$[QT_INSTALL_PLUGINS]/imageformats
+INSTALLS += target
+
+symbian: TARGET.UID3=0x20031E99
diff --git a/src/plugins/inputmethods/imsw-multi/qmultiinputcontext.cpp b/src/plugins/inputmethods/imsw-multi/qmultiinputcontext.cpp
index 258d586..25abe17 100644
--- a/src/plugins/inputmethods/imsw-multi/qmultiinputcontext.cpp
+++ b/src/plugins/inputmethods/imsw-multi/qmultiinputcontext.cpp
@@ -46,7 +46,7 @@
** Copyright (C) 2004 immodule for Qt Project. All rights reserved.
**
** This file is written to contribute to Nokia Corporation and/or its subsidiary(-ies) under their own
-** licence. You may use this file under your Qt license. Following
+** license. You may use this file under your Qt license. Following
** description is copied from their original file headers. Contact
** immodule-qt@freedesktop.org if any conditions of this licensing are
** not clear to you.
diff --git a/src/plugins/inputmethods/imsw-multi/qmultiinputcontext.h b/src/plugins/inputmethods/imsw-multi/qmultiinputcontext.h
index 5d311b3..cc1b1f0 100644
--- a/src/plugins/inputmethods/imsw-multi/qmultiinputcontext.h
+++ b/src/plugins/inputmethods/imsw-multi/qmultiinputcontext.h
@@ -46,7 +46,7 @@
** Copyright (C) 2004 immodule for Qt Project. All rights reserved.
**
** This file is written to contribute to Nokia Corporation and/or its subsidiary(-ies) under their own
-** licence. You may use this file under your Qt license. Following
+** license. You may use this file under your Qt license. Following
** description is copied from their original file headers. Contact
** immodule-qt@freedesktop.org if any conditions of this licensing are
** not clear to you.
diff --git a/src/plugins/platforms/openkode/qopenkodewindow.cpp b/src/plugins/platforms/openkode/qopenkodewindow.cpp
index c6fe6d0..dedd2d5 100644
--- a/src/plugins/platforms/openkode/qopenkodewindow.cpp
+++ b/src/plugins/platforms/openkode/qopenkodewindow.cpp
@@ -283,7 +283,7 @@ void QOpenKODEWindow::processKeyEvents(const KDEvent *event)
QEvent::Type keyPressed = QEvent::KeyRelease;
if (event->data.keyboardInputKey.flags)
keyPressed = QEvent::KeyPress;
-//KD_KEY_LOCATION_LEFT_ATX // dont care for now
+//KD_KEY_LOCATION_LEFT_ATX // don't care for now
//KD_KEY_LOCATION_RIGHT_ATX
//KD_KEY_LOCATION_NUMPAD_ATX
Qt::KeyboardModifiers mod = Qt::NoModifier;
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 80a1624..4f3021e 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -59,7 +59,7 @@
#include <X11/Xlib-xcb.h>
#endif
-#ifdef XCB_USE_EGL //dont pull in eglext prototypes
+#ifdef XCB_USE_EGL //don't pull in eglext prototypes
#include <EGL/egl.h>
#endif
diff --git a/src/src.pro b/src/src.pro
index 9314fbd..c51683b 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -8,7 +8,7 @@ SRC_SUBDIRS += src_corelib src_xml src_network src_sql src_testlib
nacl: SRC_SUBDIRS -= src_network src_testlib
!symbian:contains(QT_CONFIG, dbus):SRC_SUBDIRS += src_dbus
!contains(QT_CONFIG, no-gui): SRC_SUBDIRS += src_gui
-!wince*:!symbian:!vxworks:contains(QT_CONFIG, qt3support): SRC_SUBDIRS += src_qt3support
+!wince*:!symbian:!vxworks:!integrity:contains(QT_CONFIG, qt3support): SRC_SUBDIRS += src_qt3support
!wince*:!symbian-abld:!symbian-sbsv2:include(tools/tools.pro)
win32:!win32-g++*:SRC_SUBDIRS += src_activeqt
diff --git a/src/testlib/3rdparty/valgrind_p.h b/src/testlib/3rdparty/valgrind_p.h
index 6380a9f..70ba371 100644
--- a/src/testlib/3rdparty/valgrind_p.h
+++ b/src/testlib/3rdparty/valgrind_p.h
@@ -3703,8 +3703,8 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
/* These requests allow control to move from the simulated CPU to the
- real CPU, calling an arbitary function.
-
+ real CPU, calling an arbitrary function.
+
Note that the current ThreadId is inserted as the first argument.
So this call:
diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp
index 2c8ba6c..1cb221c 100644
--- a/src/testlib/qxmltestlogger.cpp
+++ b/src/testlib/qxmltestlogger.cpp
@@ -120,14 +120,14 @@ void QXmlTestLogger::startLogging()
QTest::qt_asprintf(&buf,
"<Environment>\n"
" <QtVersion>%s</QtVersion>\n"
- " <QTestVersion>"QTEST_VERSION_STR"</QTestVersion>\n"
+ " <QTestVersion>" QTEST_VERSION_STR "</QTestVersion>\n"
" <RandomSeed>%d</RandomSeed>\n"
"</Environment>\n", qVersion(), randomSeed);
} else {
QTest::qt_asprintf(&buf,
"<Environment>\n"
" <QtVersion>%s</QtVersion>\n"
- " <QTestVersion>"QTEST_VERSION_STR"</QTestVersion>\n"
+ " <QTestVersion>" QTEST_VERSION_STR "</QTestVersion>\n"
"</Environment>\n", qVersion());
}
outputString(buf.constData());
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 7c7cafc..ccc6e8b 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -3487,10 +3487,10 @@ QDomDocumentTypePrivate::QDomDocumentTypePrivate(QDomDocumentTypePrivate* n, boo
QDomNodePrivate* p = first;
while (p) {
if (p->isEntity())
- // Dont use normal insert function since we would create infinite recursion
+ // Don't use normal insert function since we would create infinite recursion
entities->map.insertMulti(p->nodeName(), p);
if (p->isNotation())
- // Dont use normal insert function since we would create infinite recursion
+ // Don't use normal insert function since we would create infinite recursion
notations->map.insertMulti(p->nodeName(), p);
p = p->next;
}
@@ -5725,7 +5725,7 @@ static QByteArray encodeEntity(const QByteArray& str)
len += 4;
i += 5;
} else if (d[i] == '&' && i + 1 < len && d[i+1] == '#') {
- // Dont encode &lt; or &quot; or &custom;.
+ // Don't encode &lt; or &quot; or &custom;.
// Only encode character references
tmp.replace(i, 1, "&#38;");
d = tmp;