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/corelib/kernel/qobjectdefs.h2
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
-rw-r--r--src/corelib/plugin/qplugin.h8
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp15
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp6
-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/painting/qbackingstore.cpp2
-rw-r--r--src/gui/painting/qgraphicssystem_runtime.cpp10
-rw-r--r--src/gui/painting/qgraphicssystemfactory.cpp2
-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/opengl/qgl_qpa.cpp2
-rw-r--r--src/opengl/qwindowsurface_gl.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/testlib/3rdparty/valgrind_p.h4
-rw-r--r--src/testlib/qxmltestlogger.cpp4
-rw-r--r--src/xml/dom/qdom.cpp6
59 files changed, 920 insertions, 99 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/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/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/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/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/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/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp
index 19b29a1..6d3f16e 100644
--- a/src/gui/painting/qgraphicssystem_runtime.cpp
+++ b/src/gui/painting/qgraphicssystem_runtime.cpp
@@ -330,11 +330,15 @@ QRuntimeGraphicsSystem::QRuntimeGraphicsSystem()
{
QApplicationPrivate::runtime_graphics_system = true;
+ if (!qgetenv("QT_DEFAULT_RUNTIME_SYSTEM").isEmpty()) {
+ m_graphicsSystemName = QString::fromLocal8Bit(qgetenv("QT_DEFAULT_RUNTIME_SYSTEM"));
+ } else {
#ifdef QT_DEFAULT_RUNTIME_SYSTEM
- m_graphicsSystemName = QLatin1String(QT_DEFAULT_RUNTIME_SYSTEM);
- if (m_graphicsSystemName.isNull())
+ m_graphicsSystemName = QLatin1String(QT_DEFAULT_RUNTIME_SYSTEM);
+ if (m_graphicsSystemName.isNull())
#endif
- m_graphicsSystemName = QLatin1String("raster");
+ m_graphicsSystemName = QLatin1String("raster");
+ }
#ifdef Q_OS_SYMBIAN
m_windowSurfaceDestroyPolicy = DestroyAfterFirstFlush;
diff --git a/src/gui/painting/qgraphicssystemfactory.cpp b/src/gui/painting/qgraphicssystemfactory.cpp
index 01ece09..b817a90 100644
--- a/src/gui/painting/qgraphicssystemfactory.cpp
+++ b/src/gui/painting/qgraphicssystemfactory.cpp
@@ -45,7 +45,6 @@
#include "qmutex.h"
#include "qapplication.h"
-#include <private/qapplication_p.h>
#include "qgraphicssystem_raster_p.h"
#include "qgraphicssystem_runtime_p.h"
#include "qdebug.h"
@@ -80,7 +79,6 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key)
}
#endif
- QApplicationPrivate::graphics_system_name = system;
if (system == QLatin1String("raster"))
return new QRasterGraphicsSystem;
else if (system == QLatin1String("runtime"))
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/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/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/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;