From 5e07a3ac58f93bd5e09715d43b58c20950c2befa Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 16 Nov 2011 15:27:28 +0100 Subject: Fix HarfBuzz Thai character SARA AM handling This patch is contributed by Thanomsub Noppaburana from libthai. It added a special thai shaping function to handle SARA AM character for fonts without OpenType rules to support it, like Nokia Pure Text AS. With modification to logClusters assignment to make sure that QTextLine::glyphRuns(int from, int length) returns correct glyphs. Task-number: QTBUG-21206 Change-Id: I5a78ee1ab2b4c874c7d0df17d4ee6d264ed5a790 Reviewed-by: Lars Knoll --- .../harfbuzz/src/harfbuzz-shaper-private.h | 1 + src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp | 24 +- src/3rdparty/harfbuzz/src/harfbuzz-thai.c | 367 +++++++++++++++++++-- 3 files changed, 352 insertions(+), 40 deletions(-) diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h index e1360c7..05214e7 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h @@ -111,6 +111,7 @@ extern HB_Bool HB_HangulShape(HB_ShaperItem *shaper_item); extern HB_Bool HB_MyanmarShape(HB_ShaperItem *shaper_item); extern HB_Bool HB_KhmerShape(HB_ShaperItem *shaper_item); extern HB_Bool HB_IndicShape(HB_ShaperItem *shaper_item); +extern HB_Bool HB_ThaiShape(HB_ShaperItem *shaper_item); extern void HB_TibetanAttributes(HB_Script script, const HB_UChar16 *string, hb_uint32 from, hb_uint32 len, HB_CharAttributes *attributes); diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp index 1021b02..975318e 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp @@ -618,7 +618,7 @@ const HB_ScriptEngine HB_ScriptEngines[] = { // Sinhala { HB_IndicShape, HB_IndicAttributes }, // Thai - { HB_BasicShape, HB_ThaiAttributes }, + { HB_ThaiShape, HB_ThaiAttributes }, // Lao { HB_BasicShape, 0 }, // Tibetan @@ -1308,18 +1308,18 @@ HB_Bool HB_OpenTypePosition(HB_ShaperItem *item, int availableGlyphs, HB_Bool do #ifdef OT_DEBUG if (doLogClusters) { - DEBUG("log clusters after shaping:"); - for (int j = 0; j < length; j++) - DEBUG(" log[%d] = %d", j, item->log_clusters[j]); + DEBUG("log clusters after shaping:\n"); + for (unsigned int j = 0; j < item->item.length; j++) + DEBUG(" log[%d] = %d\n", j, item->log_clusters[j]); } - DEBUG("final glyphs:"); - for (int i = 0; i < (int)hb_buffer->in_length; ++i) - DEBUG(" glyph=%4x char_index=%d mark: %d cmp: %d, clusterStart: %d advance=%d/%d offset=%d/%d", - glyphs[i].glyph, hb_buffer->in_string[i].cluster, glyphs[i].attributes.mark, - glyphs[i].attributes.combiningClass, glyphs[i].attributes.clusterStart, - glyphs[i].advance.x.toInt(), glyphs[i].advance.y.toInt(), - glyphs[i].offset.x.toInt(), glyphs[i].offset.y.toInt()); - DEBUG("-----------------------------------------"); + DEBUG("final glyphs:\n"); + for (unsigned int i = 0; i < item->num_glyphs; ++i) + DEBUG(" glyph=%4x char_index=%d mark: %d cmp: %d, clusterStart: %d advance=%d offset=%d/%d\n", + glyphs[i], face->buffer->in_string[i].cluster, attributes[i].mark, + attributes[i].combiningClass, attributes[i].clusterStart, + item->advances[i] >> 6, + item->offsets[i].x >> 6, item->offsets[i].y >> 6); + DEBUG("-----------------------------------------\n"); #endif return true; } diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c index e80e2c5..262cee6 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c @@ -29,15 +29,41 @@ #include #include -typedef int (*th_brk_def)(const char*, int[], int); +#define LIBTHAI_MAJOR 0 + +/* + * if libthai changed please update these codes too. + */ +struct thcell_t { + unsigned char base; /**< base character */ + unsigned char hilo; /**< upper/lower vowel/diacritic */ + unsigned char top; /**< top-level mark */ +}; +typedef int (*th_brk_def) (const unsigned char*, int*, size_t); +typedef int (*th_render_cell_tis_def) (struct thcell_t cell, unsigned char res[], size_t res_sz, int is_decomp_am); +typedef int (*th_render_cell_win_def) (struct thcell_t cell, unsigned char res[], size_t res_sz, int is_decomp_am); +typedef int (*th_render_cell_mac_def) (struct thcell_t cell, unsigned char res[], size_t res_sz, int is_decomp_am); +typedef size_t (*th_next_cell_def) (const unsigned char *, size_t, struct thcell_t *, int); + +/* libthai releated function handles */ static th_brk_def th_brk = 0; -static int libthai_resolved = 0; +static th_next_cell_def th_next_cell = 0; +static th_render_cell_tis_def th_render_cell_tis = 0; +static th_render_cell_win_def th_render_cell_win = 0; +static th_render_cell_mac_def th_render_cell_mac = 0; -static void resolve_libthai() -{ - if (!th_brk) - th_brk = (th_brk_def)HB_Library_Resolve("thai", 0, "th_brk"); - libthai_resolved = 1; +static int init_libthai() { + if (!th_brk || !th_next_cell || !th_render_cell_tis || !th_render_cell_win || !th_render_cell_mac) { + th_brk = (th_brk_def) HB_Library_Resolve("thai", (int)LIBTHAI_MAJOR, "th_brk"); + th_next_cell = (th_next_cell_def)HB_Library_Resolve("thai", LIBTHAI_MAJOR, "th_next_cell"); + th_render_cell_tis = (th_render_cell_tis_def) HB_Library_Resolve("thai", (int)LIBTHAI_MAJOR, "th_render_cell_tis"); + th_render_cell_win = (th_render_cell_win_def) HB_Library_Resolve("thai", (int)LIBTHAI_MAJOR, "th_render_cell_win"); + th_render_cell_mac = (th_render_cell_mac_def) HB_Library_Resolve("thai", (int)LIBTHAI_MAJOR, "th_render_cell_mac"); + } + if (th_brk && th_next_cell && th_render_cell_tis && th_render_cell_win && th_render_cell_mac) + return 1; + else + return 0; } static void to_tis620(const HB_UChar16 *string, hb_uint32 len, const char *cstr) @@ -57,46 +83,329 @@ static void to_tis620(const HB_UChar16 *string, hb_uint32 len, const char *cstr) result[len] = 0; } -static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttributes *attributes) +/* + * --------------------------------------------------------------------------- + * Thai Shaper / Attributes + * --------------------------------------------------------------------------- + */ + +/* + * USe basic_features prepare for future adding. + */ +#ifndef NO_OPENTYPE +static const HB_OpenTypeFeature thai_features[] = { + { HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty }, + { HB_MAKE_TAG('l', 'i', 'g', 'a'), CcmpProperty }, + { HB_MAKE_TAG('c', 'l', 'i', 'g'), CcmpProperty }, + {0, 0} +}; +#endif + +/* TIS-to-Unicode glyph maps for characters 0x80-0xff */ +static int tis620_0[128] = { + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + /**/ 0, 0, 0, 0, 0, 0, 0, 0, + 0x0020, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, + 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, + 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, + 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, + 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, + 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, + 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, + 0x0e38, 0x0e39, 0x0e3a, 0, 0, 0, 0, 0x0e3f, + 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, + 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f, + 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, + 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0, 0, 0, 0 +}; + +static int tis620_1[128] = { + 0xf89e, 0, 0, 0xf88c, 0xf88f, 0xf892, 0xf895, 0xf898, + 0xf88b, 0xf88e, 0xf891, 0xf894, 0xf897, 0, 0, 0xf899, + 0xf89a, 0, 0xf884, 0xf889, 0xf885, 0xf886, 0xf887, 0xf888, + 0xf88a, 0xf88d, 0xf890, 0xf893, 0xf896, 0, 0, 0, + /**/ 0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, + 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, + 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, + 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, + 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, + 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, + 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, + 0x0e38, 0x0e39, 0x0e3a, 0, 0, 0, 0, 0x0e3f, + 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, + 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0, 0x0e4f, + 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, + 0x0e58, 0x0e59, 0, 0, 0xf89b, 0xf89c, 0xf89d, 0 +}; + +static int tis620_2[128] = { + 0xf700, 0xf701, 0xf702, 0xf703, 0xf704, 0x2026, 0xf705, 0xf706, + 0xf707, 0xf708, 0xf709, 0xf70a, 0xf70b, 0xf70c, 0xf70d, 0xf70e, + 0xf70f, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, + 0xf710, 0xf711, 0xf712, 0xf713, 0xf714, 0xf715, 0xf716, 0xf717, + 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, + 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, + 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, + 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, + 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, + 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, + 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, + 0x0e38, 0x0e39, 0x0e3a, 0, 0, 0, 0, 0x0e3f, + 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, + 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f, + 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, + 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0xf718, 0xf719, 0xf71a, 0 +}; + +enum ThaiFontType { + TIS, + WIN, + MAC, +}; + +static int thai_get_glyph_index (ThaiFontType font_type, unsigned char c) +{ + switch (font_type){ + case TIS: return (c & 0x80) ? tis620_0[c & 0x7f] : c; + case WIN: return (c & 0x80) ? tis620_1[c & 0x7f] : c; + case MAC: return (c & 0x80) ? tis620_2[c & 0x7f] : c; + default: return 0; + } +} + +static int thai_contain_glyphs (HB_ShaperItem *shaper_item, const int glyph_map[128]) +{ + unsigned char c; + + for (c = 0; c < 0x80; c++) { + if ( glyph_map[c] ) { + if ( !shaper_item->font->klass->canRender (shaper_item->font, (HB_UChar16 *) &glyph_map[c], 1) ) + return 0; + } + } + return 1; +} + +static ThaiFontType getThaiFontType(HB_ShaperItem *shaper_item) +{ + if ( thai_contain_glyphs (shaper_item, tis620_2) ) + return MAC; + else if ( thai_contain_glyphs (shaper_item, tis620_1) ) + return WIN; + else + return TIS; +} + +/* + * convert to the correct display level of THAI vowels and marks. + */ +static HB_Bool HB_ThaiConvertStringToGlyphIndices (HB_ShaperItem *item) { char s[128]; char *cstr = s; - int brp[128]; - int *break_positions = brp; - hb_uint32 numbreaks; - hb_uint32 i; + const HB_UChar16 *string = item->string + item->item.pos; + const hb_uint32 len = item->item.length; + unsigned short *logClusters = item->log_clusters; + hb_uint32 i = 0, slen = 0; - if (!libthai_resolved) - resolve_libthai(); - - if (!th_brk) - return; + if (!init_libthai()) + return HB_BasicShape (item); if (len >= 128) cstr = (char *)malloc(len*sizeof(char) + 1); + if (!cstr) + return HB_BasicShape (item); + to_tis620(string, len, cstr); - numbreaks = th_brk(cstr, break_positions, 128); - if (numbreaks > 128) { - break_positions = (int *)malloc(numbreaks * sizeof(int)); - numbreaks = th_brk(cstr, break_positions, numbreaks); + /* Get font type */ + static ThaiFontType font_type; + static HB_Font itemFont; + if (itemFont != item->font) { + font_type = getThaiFontType (item); + itemFont = item->font; + } + + /* allocate temporary glyphs buffers */ + HB_STACKARRAY (HB_UChar16, glyphString, (item->item.length * 2)); + + while (i < item->item.length) { + struct thcell_t tis_cell; + unsigned char rglyphs[4]; + int cell_length; + int lgn = 0; + HB_Bool haveSaraAm = false; + + cell_length = th_next_cell ((const unsigned char *)cstr + i, len - i, &tis_cell, true); /* !item->fixedPitch); */ + haveSaraAm = (cstr[i + cell_length - 1] == (char)0xd3); + + /* set shaper item's log_clusters */ + logClusters[i] = slen; + for (int j = 1; j < cell_length; j++) { + logClusters[i + j] = logClusters[i]; + } + + /* Find Logical Glyphs by font type */ + switch (font_type) { + case TIS: lgn = th_render_cell_tis (tis_cell, rglyphs, sizeof(rglyphs) / sizeof(rglyphs[0]), true); break; + case WIN: lgn = th_render_cell_mac (tis_cell, rglyphs, sizeof(rglyphs) / sizeof(rglyphs[0]), true); break; + case MAC: lgn = th_render_cell_win (tis_cell, rglyphs, sizeof(rglyphs) / sizeof(rglyphs[0]), true); break; + } + + /* Add glyphs to glyphs string and setting some attributes */ + for (int lgi = 0; lgi < lgn; lgi++) { + if ( rglyphs[lgi] == 0xdd/*TH_BLANK_BASE_GLYPH*/ ) { + //if ( !item->fixedPitch ) { + glyphString[slen++] = C_DOTTED_CIRCLE; + item->attributes[slen-1].dontPrint = true; // FIXME this will hide all dotted circle + //} + } + else { + glyphString[slen++] = (HB_UChar16) thai_get_glyph_index (font_type, rglyphs[lgi]); + } + } + + if (haveSaraAm) { + logClusters[i + cell_length - 1] = slen - 1; // Set logClusters before NIKAHIT + if (tis_cell.top != 0) + logClusters[i + cell_length - 2] = slen - 2; // Set logClusters before NIKAHIT when tis_cell has top + if (logClusters[i + cell_length - 1] > slen) + logClusters[i + cell_length - 1] = 0; + } + + i += cell_length; + } + glyphString[slen] = (HB_UChar16) '\0'; + + /* for check, should reallocate space or not */ + HB_Bool spaceOK = (item->num_glyphs >= slen); + + /* Convert to Glyph indices */ + HB_Bool haveGlyphs = item->font->klass->convertStringToGlyphIndices ( + item->font, + glyphString, slen, + item->glyphs, &item->num_glyphs, + item->shaperFlags); + + HB_FREE_STACKARRAY (glyphString); + + if (len >= 128) + free(cstr); + + return (haveGlyphs && spaceOK); +} + +/* + * set the glyph attributes heuristically. + */ +static void HB_ThaiHeuristicSetGlyphAttributes (HB_ShaperItem *item) +{ + /* Set Glyph Attributes */ + hb_uint32 iCluster = 0; + hb_uint32 length = item->item.length; + while (iCluster < length) { + int cluster_start = item->log_clusters[iCluster]; + ++iCluster; + while (iCluster < length && item->log_clusters[iCluster] == cluster_start) { + ++iCluster; + } + int cluster_end = (iCluster < length) ? item->log_clusters[iCluster] : item->num_glyphs; + item->attributes[cluster_start].clusterStart = true; + for (int i = cluster_start + 1; i < cluster_end; i++) { + item->attributes[i].clusterStart = false; + } + } +} + +/* + * THAI Shaping. + */ +HB_Bool HB_ThaiShape (HB_ShaperItem *shaper_item) +{ + if ( !HB_ThaiConvertStringToGlyphIndices (shaper_item) ) + return false; + + HB_ThaiHeuristicSetGlyphAttributes (shaper_item); + +#ifndef NO_OPENTYPE + const int availableGlyphs = shaper_item->num_glyphs; + if ( HB_SelectScript (shaper_item, thai_features) ) { + HB_OpenTypeShape (shaper_item, /*properties*/0); + return HB_OpenTypePosition (shaper_item, availableGlyphs, /*doLogClusters*/false); } +#endif + + HB_HeuristicPosition (shaper_item); + return true; +} + +/* + * Thai Attributes: computes Word Break, Word Boundary and Char stop for THAI. + */ +static void HB_ThaiAssignAttributes(const HB_UChar16 *string, hb_uint32 len, HB_CharAttributes *attributes) +{ + char s[128]; + char *cstr = s; + int *break_positions = 0; + int brp[128]; + int brp_size = 0; + hb_uint32 numbreaks, i, j, cell_length; + struct thcell_t tis_cell; + + if (!init_libthai()) + return ; + + if (len >= 128) + cstr = (char *)malloc(len*sizeof(char) + 1); + + to_tis620(string, len, cstr); for (i = 0; i < len; ++i) { attributes[i].lineBreakType = HB_NoBreak; attributes[i].wordBoundary = FALSE; } - for (i = 0; i < numbreaks; ++i) { - if (break_positions[i] > 0) { - attributes[break_positions[i]-1].lineBreakType = HB_Break; - attributes[break_positions[i]-1].wordBoundary = TRUE; + if (len > 128) { + break_positions = (int*) malloc (sizeof(int) * len); + memset (break_positions, 0, sizeof(int) * len); + brp_size = len; + } + else { + break_positions = brp; + brp_size = 128; + } + + if (break_positions) { + attributes[0].wordBoundary = TRUE; + numbreaks = th_brk((const unsigned char *)cstr, break_positions, brp_size); + for (i = 0; i < numbreaks; ++i) { + attributes[break_positions[i]].wordBoundary = TRUE; + if (break_positions[i] > 0) + attributes[break_positions[i]-1].lineBreakType = HB_Break; } + + if (break_positions != brp) + free(break_positions); } - if (break_positions != brp) - free(break_positions); + /* manage charStop */ + i = 0; + while (i < len) { + cell_length = th_next_cell((const unsigned char *)cstr + i, len - i, &tis_cell, true); + + attributes[i].charStop = true; + for (j = 1; j < cell_length; j++) + attributes[i + j].charStop = false; + + /* Set charStop for SARA AM */ + if (cstr[i + cell_length - 1] == (char)0xd3) + attributes[i + cell_length - 1].charStop = true; + + i += cell_length; + } if (len >= 128) free(cstr); @@ -105,7 +414,9 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri void HB_ThaiAttributes(HB_Script script, const HB_UChar16 *text, hb_uint32 from, hb_uint32 len, HB_CharAttributes *attributes) { assert(script == HB_Script_Thai); + const HB_UChar16 *uc = text + from; attributes += from; - thaiWordBreaks(text + from, len, attributes); + HB_UNUSED(script); + HB_ThaiAssignAttributes(uc, len, attributes); } -- cgit v0.12 From 04ae67db5330c379ab05e91132dd28c517e280c6 Mon Sep 17 00:00:00 2001 From: mread Date: Wed, 30 Nov 2011 13:18:11 +0000 Subject: Reduce unnecessary QtCore DLL loads during Symbian app thread creation The Symbain fast allocator integration in Qt 4.7 loads QtCore.DLL to check availablility. This load has been causing a crash in the Nokia Store app when a different version of QtCore 4.7 is installed. The new DLL is loaded and it's static data tries to initialise before the allocator is set up. This change stores the allocator setup function so that extra DLL loads are not required. Now the same allocator setup function is used for the lifetime of the app. Reviewed-by: Shane Kearns --- src/s60main/newallocator_hook.cpp | 40 +++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/s60main/newallocator_hook.cpp b/src/s60main/newallocator_hook.cpp index 7e0b344..4cec214 100644 --- a/src/s60main/newallocator_hook.cpp +++ b/src/s60main/newallocator_hook.cpp @@ -109,26 +109,38 @@ struct SStdEpocThreadCreateInfo : public SThreadCreateInfo * startup. On return, there is some kind of heap allocator installed on the * thread. */ +typedef int (*TSetupThreadHeapFunc)(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); +// keep the SetupThreadHeap() pointer so that we don't reload QtCore.dll after the first time +static TSetupThreadHeapFunc gp_qt_symbian_SetupThreadHeap = 0; +static bool gp_qt_symbian_SetupThreadHeap_set = false; + TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo) { TInt r = KErrNone; #ifndef __WINS__ - // attempt to create the fast allocator through a known export ordinal in qtcore.dll - RLibrary qtcore; - if (qtcore.Load(QtCoreLibName) == KErrNone) - { - const int qt_symbian_SetupThreadHeap_eabi_ordinal = 3713; - TLibraryFunction libFunc = qtcore.Lookup(qt_symbian_SetupThreadHeap_eabi_ordinal); - if (libFunc) - { - typedef int (*TSetupThreadHeapFunc)(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); - TSetupThreadHeapFunc p_qt_symbian_SetupThreadHeap = TSetupThreadHeapFunc(libFunc); - r = (*p_qt_symbian_SetupThreadHeap)(aNotFirst, aInfo); + // on first call, aNotFirst will be false. + // on second call, gp_qt_symbian_SetupThreadHeap_set will be false(!) because WSD is zeroed after the first call + // on subsequent calls, both will be true and we can use the stored SetupThreadHeap() pointer + if (aNotFirst && gp_qt_symbian_SetupThreadHeap_set) { + if (gp_qt_symbian_SetupThreadHeap) + return (*gp_qt_symbian_SetupThreadHeap)(aNotFirst, aInfo); + } else { + // attempt to create the fast allocator through a known export ordinal in qtcore.dll + RLibrary qtcore; + gp_qt_symbian_SetupThreadHeap_set = true; + if (qtcore.Load(QtCoreLibName) == KErrNone) { + const int qt_symbian_SetupThreadHeap_eabi_ordinal = 3713; + TLibraryFunction libFunc = qtcore.Lookup(qt_symbian_SetupThreadHeap_eabi_ordinal); + if (libFunc) { + TSetupThreadHeapFunc p_qt_symbian_SetupThreadHeap = TSetupThreadHeapFunc(libFunc); + gp_qt_symbian_SetupThreadHeap = p_qt_symbian_SetupThreadHeap; + r = (*p_qt_symbian_SetupThreadHeap)(aNotFirst, aInfo); + } + qtcore.Close(); + if (libFunc) + return r; } - qtcore.Close(); - if (libFunc) - return r; } #endif -- cgit v0.12 From 1290b1328c5168db0b922dfd19ba88db3cc265cf Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sun, 4 Dec 2011 02:59:31 +0100 Subject: tests: make tests compile or disable those which don't compile These changes are mostly a backport from qtbase and a fix to those tests that are dependent on private APIs. Change-Id: I6e647583d7aaddf525d719c3b61f59a0c9aedf74 Reviewed-by: Rohan McGovern Reviewed-by: Friedemann Kleint --- tests/auto/corelib.pro | 4 ++++ tests/auto/dbus.pro | 2 ++ tests/auto/gui.pro | 25 +++++++++++++++++----- tests/auto/network.pro | 6 ++++++ tests/auto/other.pro | 2 ++ tests/auto/qtipc/qsharedmemory/qsharedmemory.pro | 4 +++- tests/auto/qtipc/qtipc.pro | 4 ++++ tests/auto/script.pro | 2 ++ tests/auto/xmlpatterns.pro | 1 + tests/benchmarks/corelib/io/io.pro | 2 +- tests/benchmarks/corelib/io/qdiriterator/main.cpp | 5 +++-- .../corelib/io/qdiriterator/qdiriterator.pro | 2 -- .../io/qdiriterator/qfilesystemiterator.cpp | 2 +- tests/benchmarks/corelib/io/qfile/main.cpp | 1 - .../qtimer_vs_qmetaobject.pro | 2 -- .../corelib/kernel/qvariant/qvariant.pro | 2 -- tests/benchmarks/corelib/tools/qregexp/qregexp.pro | 2 +- tests/benchmarks/corelib/tools/qstring/main.cpp | 11 +++++++--- .../corelib/tools/qstringlist/qstringlist.pro | 1 - tests/benchmarks/corelib/tools/tools.pro | 4 +++- tests/benchmarks/declarative/declarative.pro | 6 ++++++ .../gui/animation/qanimation/qanimation.pro | 2 -- tests/benchmarks/gui/graphicsview/graphicsview.pro | 2 +- .../qgraphicsview/tst_qgraphicsview.cpp | 5 +---- tests/benchmarks/gui/kernel/qapplication/main.cpp | 2 +- tests/benchmarks/network/kernel/kernel.pro | 3 +++ 26 files changed, 73 insertions(+), 31 deletions(-) diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro index 6810f76..cb1f2ef 100644 --- a/tests/auto/corelib.pro +++ b/tests/auto/corelib.pro @@ -105,6 +105,10 @@ SUBDIRS=\ qfilesystementry \ qabstractfileengine +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qfileinfo \ + qfilesystementry \ + symbian:SUBDIRS -= \ qtconcurrentfilter \ qtconcurrentiteratekernel \ diff --git a/tests/auto/dbus.pro b/tests/auto/dbus.pro index 31b46a3..7470bf8 100644 --- a/tests/auto/dbus.pro +++ b/tests/auto/dbus.pro @@ -17,3 +17,5 @@ SUBDIRS=\ qdbusthreading \ qdbusxmlparser \ +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qdbusmarshall \ diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro index 17f56f2..cde39c2 100644 --- a/tests/auto/gui.pro +++ b/tests/auto/gui.pro @@ -209,11 +209,26 @@ SUBDIRS=\ win32:SUBDIRS -= qtextpiecetable !contains(QT_CONFIG, private_tests): SUBDIRS -= \ - qgraphicssceneindex \ - qnetworkreply \ - qpathclipper \ - qstylesheetstyle \ - qtextpiecetable \ + qcolumnview \ + qgraphicsanchorlayout \ + qgraphicsanchorlayout1 \ + qgraphicsitem \ + qgraphicsscene \ + qgraphicssceneindex \ + qlistwidget \ + qmainwindow \ + qnetworkreply \ + qpathclipper \ + qpixmapcache \ + qsidebar \ + qstatictext \ + qstylesheetstyle \ + qtcpsocket \ + qtextlayout \ + qtextpiecetable \ + qtipc \ + qtoolbar \ + qtreeview \ symbian:SUBDIRS -= \ qsystemtrayicon \ diff --git a/tests/auto/network.pro b/tests/auto/network.pro index e4cecce..9eb358f 100644 --- a/tests/auto/network.pro +++ b/tests/auto/network.pro @@ -46,9 +46,15 @@ SUBDIRS=\ !contains(QT_CONFIG, private_tests): SUBDIRS -= \ qauthenticator \ + qhostinfo \ qhttpnetworkconnection \ qhttpnetworkreply \ + qhttpsocketengine \ + qnetworkreply \ platformsocketengine \ qsocketnotifier \ qsocks5socketengine \ + qsslsocket \ + qsslsocket_onDemandCertificates_member \ + qsslsocket_onDemandCertificates_static \ diff --git a/tests/auto/other.pro b/tests/auto/other.pro index 655d666..b50e169 100644 --- a/tests/auto/other.pro +++ b/tests/auto/other.pro @@ -60,5 +60,7 @@ symbian { # Following tests depends on private API !contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qcombobox \ qcssparser \ + qtextedit \ diff --git a/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro b/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro index 9fef8e4..3193caa 100644 --- a/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro +++ b/tests/auto/qtipc/qsharedmemory/qsharedmemory.pro @@ -1,4 +1,6 @@ TEMPLATE = subdirs SUBDIRS = test qsystemlock - +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + test \ + qsystemlock \ diff --git a/tests/auto/qtipc/qtipc.pro b/tests/auto/qtipc/qtipc.pro index 60037d2..fb32e51 100644 --- a/tests/auto/qtipc/qtipc.pro +++ b/tests/auto/qtipc/qtipc.pro @@ -4,3 +4,7 @@ SUBDIRS=\ qsharedmemory \ qsystemsemaphore \ +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + lackey \ + qsharedmemory \ + qsystemsemaphore \ diff --git a/tests/auto/script.pro b/tests/auto/script.pro index c4d0544..80d259d 100644 --- a/tests/auto/script.pro +++ b/tests/auto/script.pro @@ -16,3 +16,5 @@ SUBDIRS=\ qscriptvaluegenerated \ qscriptvalueiterator \ +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qscriptcontext \ diff --git a/tests/auto/xmlpatterns.pro b/tests/auto/xmlpatterns.pro index b9244d6..4940cc4 100644 --- a/tests/auto/xmlpatterns.pro +++ b/tests/auto/xmlpatterns.pro @@ -46,4 +46,5 @@ xmlpatternsxqts.depends = xmlpatternssdk xmlpatternssdk \ xmlpatternsxqts \ xmlpatternsxslts \ + xmlpatternsschemats \ diff --git a/tests/benchmarks/corelib/io/io.pro b/tests/benchmarks/corelib/io/io.pro index 97445d7..15ae0d2 100644 --- a/tests/benchmarks/corelib/io/io.pro +++ b/tests/benchmarks/corelib/io/io.pro @@ -3,7 +3,7 @@ SUBDIRS = \ qdir \ qdiriterator \ qfile \ - qfileinfo \ + #qfileinfo \ # FIXME: broken qiodevice \ qtemporaryfile diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp index 0d0251f..8b1dbe2 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp @@ -44,7 +44,6 @@ #ifdef Q_OS_WIN # include -# include #else # include # include @@ -176,7 +175,9 @@ void tst_qdiriterator::posix() QString path(dirpath); QBENCHMARK { #ifdef Q_OS_WIN - count = posix_helper(path.utf16()); + wchar_t wPath[MAX_PATH]; + path.toWCharArray(wPath); + count = posix_helper(wPath); #else count = posix_helper(dirpath.constData()); #endif diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro index 17d164d..a501b1b 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro +++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro @@ -7,8 +7,6 @@ INCLUDEPATH += . QT -= gui CONFIG += release -CONFIG += debug - SOURCES += main.cpp diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp index 935bccd..ede398d 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp @@ -229,7 +229,7 @@ void QFileSystemIteratorPrivate::pushSubDirectory(const QByteArray &path) #ifdef Q_OS_WIN wchar_t szSearchPath[MAX_PATH]; - wcscpy(szSearchPath, QString(path).utf16()); + QString::fromAscii(path).toWCharArray(szSearchPath); wcscat(szSearchPath, L"\\*"); HANDLE dir = FindFirstFile(szSearchPath, &m_fileSearchResult); m_bFirstSearchResult = true; diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp index 6211751..e22637a 100644 --- a/tests/benchmarks/corelib/io/qfile/main.cpp +++ b/tests/benchmarks/corelib/io/qfile/main.cpp @@ -51,7 +51,6 @@ #ifdef Q_OS_WIN # include -# include #endif #define BUFSIZE 1024*512 diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro index 5ecb94c..3f1272d 100644 --- a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro +++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/qtimer_vs_qmetaobject.pro @@ -5,8 +5,6 @@ DEPENDPATH += . INCLUDEPATH += . CONFIG += release -#CONFIG += debug - SOURCES += tst_qtimer_vs_qmetaobject.cpp QT -= gui diff --git a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro index f3dd66a..59e0070 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro +++ b/tests/benchmarks/corelib/kernel/qvariant/qvariant.pro @@ -5,7 +5,5 @@ DEPENDPATH += . INCLUDEPATH += . CONFIG += release -#CONFIG += debug - SOURCES += tst_qvariant.cpp diff --git a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro index ffdad12..eea5d87 100644 --- a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro +++ b/tests/benchmarks/corelib/tools/qregexp/qregexp.pro @@ -12,7 +12,7 @@ CONFIG += release # Input SOURCES += main.cpp -include( $${QT_SOURCE_TREE}/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri ) +include( $${QT_SOURCE_TREE}/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pri ) exists( /usr/include/boost/regex.hpp ){ DEFINES+=HAVE_BOOST diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp index daefe12..943302c 100644 --- a/tests/benchmarks/corelib/tools/qstring/main.cpp +++ b/tests/benchmarks/corelib/tools/qstring/main.cpp @@ -58,6 +58,11 @@ #include #endif +// MAP_ANON is deprecated on Linux, and MAP_ANONYMOUS is not present on Mac +#ifndef MAP_ANONYMOUS +# define MAP_ANONYMOUS MAP_ANON +#endif + #include #include "data.h" @@ -789,7 +794,7 @@ static void __attribute__((noinline)) equals2_selftest() void *page1, *page3; ushort *page2; page1 = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - page2 = (ushort *)mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0); + page2 = (ushort *)mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); page3 = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); Q_ASSERT(quintptr(page2) == quintptr(page1) + pagesize || quintptr(page2) == quintptr(page1) - pagesize); @@ -938,7 +943,7 @@ static inline int ucstrncmp_short_tail(const ushort *p1, const ushort *p2, int l return 0; } -static inline int bsf_nonzero(register long val) +static inline int bsf_nonzero(register int val) { int result; # ifdef Q_CC_GNU @@ -1346,7 +1351,7 @@ void tst_QString::ucstrncmp() const void *page1, *page3; ushort *page2; page1 = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - page2 = (ushort *)mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0); + page2 = (ushort *)mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); page3 = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); Q_ASSERT(quintptr(page2) == quintptr(page1) + pagesize || quintptr(page2) == quintptr(page1) - pagesize); diff --git a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro b/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro index 06a5836..b4a4622 100644 --- a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro +++ b/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro @@ -1,6 +1,5 @@ load(qttest_p4) TARGET = tst_bench_qstringlist -CONFIG -= debug CONFIG += release QT -= gui SOURCES += main.cpp diff --git a/tests/benchmarks/corelib/tools/tools.pro b/tests/benchmarks/corelib/tools/tools.pro index 83a9411..9ad3950 100644 --- a/tests/benchmarks/corelib/tools/tools.pro +++ b/tests/benchmarks/corelib/tools/tools.pro @@ -6,8 +6,10 @@ SUBDIRS = \ qline \ qlist \ qrect \ - qregexp \ + #qregexp \ # FIXME: broken qstring \ qstringbuilder \ qstringlist \ qvector + +!*g++*: SUBDIRS -= qstring diff --git a/tests/benchmarks/declarative/declarative.pro b/tests/benchmarks/declarative/declarative.pro index 73e40b2..4534d81 100644 --- a/tests/benchmarks/declarative/declarative.pro +++ b/tests/benchmarks/declarative/declarative.pro @@ -12,4 +12,10 @@ SUBDIRS += \ contains(QT_CONFIG, opengl): SUBDIRS += painting qmlshadersplugin +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + creation \ + pointers \ + qdeclarativeimage \ + script \ + include(../trusted-benchmarks.pri) diff --git a/tests/benchmarks/gui/animation/qanimation/qanimation.pro b/tests/benchmarks/gui/animation/qanimation/qanimation.pro index 53a139a..e42a830 100644 --- a/tests/benchmarks/gui/animation/qanimation/qanimation.pro +++ b/tests/benchmarks/gui/animation/qanimation/qanimation.pro @@ -5,8 +5,6 @@ DEPENDPATH += . INCLUDEPATH += . CONFIG += release -#CONFIG += debug - SOURCES += main.cpp \ dummyobject.cpp \ diff --git a/tests/benchmarks/gui/graphicsview/graphicsview.pro b/tests/benchmarks/gui/graphicsview/graphicsview.pro index 1509466..cd7d88e 100644 --- a/tests/benchmarks/gui/graphicsview/graphicsview.pro +++ b/tests/benchmarks/gui/graphicsview/graphicsview.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ - functional \ + #functional \ # FIXME: broken qgraphicsanchorlayout \ qgraphicsitem \ qgraphicslayout \ diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 3b690da..9497227 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -40,11 +40,8 @@ ****************************************************************************/ #include +#include #include -#include -#include -#include -#include #include "chiptester/chiptester.h" //#define CALLGRIND_DEBUG diff --git a/tests/benchmarks/gui/kernel/qapplication/main.cpp b/tests/benchmarks/gui/kernel/qapplication/main.cpp index 6399168..6231980 100644 --- a/tests/benchmarks/gui/kernel/qapplication/main.cpp +++ b/tests/benchmarks/gui/kernel/qapplication/main.cpp @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include +#include #include diff --git a/tests/benchmarks/network/kernel/kernel.pro b/tests/benchmarks/network/kernel/kernel.pro index 1ec3071..13345a5 100644 --- a/tests/benchmarks/network/kernel/kernel.pro +++ b/tests/benchmarks/network/kernel/kernel.pro @@ -1,3 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ qhostinfo + +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qhostinfo -- cgit v0.12 From 75155a7345dab9033552a8cd9c2f2655965ef83c Mon Sep 17 00:00:00 2001 From: Honglei Zhang Date: Wed, 7 Dec 2011 11:56:45 +0200 Subject: Revert "Fix sqlite driver memory eating due to close failure" This reverts commit 9a5fb6bd5f0fb3b37897bf722e4cc1673309623c. The mentioned fix has caused failure in qtcreator. Thus it has to be reverted and new fix for the memory leak will be made. --- src/sql/drivers/sqlite/qsql_sqlite.cpp | 7 ----- tests/auto/qsqlquery/tst_qsqlquery.cpp | 49 ---------------------------------- 2 files changed, 56 deletions(-) diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index 38e4a63..8294a55 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -104,7 +104,6 @@ class QSQLiteDriverPrivate public: inline QSQLiteDriverPrivate() : access(0) {} sqlite3 *access; - QList results; }; @@ -287,12 +286,10 @@ QSQLiteResult::QSQLiteResult(const QSQLiteDriver* db) { d = new QSQLiteResultPrivate(this); d->access = db->d->access; - db->d->results.append(this); } QSQLiteResult::~QSQLiteResult() { - qobject_cast(driver())->d->results.removeOne(this); d->cleanup(); delete d; } @@ -556,10 +553,6 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c void QSQLiteDriver::close() { if (isOpen()) { - foreach (QSQLiteResult *result, d->results) { - result->d->finalize(); - } - if (sqlite3_close(d->access) != SQLITE_OK) setLastError(qMakeError(d->access, tr("Error closing database"), QSqlError::ConnectionError)); diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 652a82e..3cbdb63 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -215,8 +215,6 @@ private slots: void QTBUG_14132(); void QTBUG_21884_data() { generic_data("QSQLITE"); } void QTBUG_21884(); - void QTBUG_16967_data() { generic_data("QSQLITE"); } - void QTBUG_16967(); //clean close void sqlite_constraint_data() { generic_data("QSQLITE"); } void sqlite_constraint(); @@ -3152,53 +3150,6 @@ void tst_QSqlQuery::QTBUG_21884() } } -/** - * This test case test sqlite driver close function. Sqlite driver should close cleanly - * even if there is still outstanding prepared statement. - */ -void tst_QSqlQuery::QTBUG_16967() -{ - QFETCH(QString, dbName); - { - QSqlDatabase db = QSqlDatabase::database(dbName); - CHECK_DATABASE(db); - db.close(); - QCOMPARE(db.lastError().type(), QSqlError::NoError); - } - { - QSqlDatabase db = QSqlDatabase::database(dbName); - CHECK_DATABASE(db); - QSqlQuery q(db); - q.prepare("CREATE TABLE t1 (id INTEGER PRIMARY KEY, str TEXT);"); - db.close(); - QCOMPARE(db.lastError().type(), QSqlError::NoError); - } - { - QSqlDatabase db = QSqlDatabase::database(dbName); - CHECK_DATABASE(db); - QSqlQuery q(db); - q.prepare("CREATE TABLE t1 (id INTEGER PRIMARY KEY, str TEXT);"); - q.exec(); - db.close(); - QCOMPARE(db.lastError().type(), QSqlError::NoError); - } - { - QSqlDatabase db = QSqlDatabase::database(dbName); - CHECK_DATABASE(db); - QSqlQuery q(db); - q.exec("INSERT INTO t1 (id, str) VALUES(1, \"test1\");"); - db.close(); - QCOMPARE(db.lastError().type(), QSqlError::NoError); - } - { - QSqlDatabase db = QSqlDatabase::database(dbName); - CHECK_DATABASE(db); - QSqlQuery q(db); - q.exec("SELECT * FROM t1;"); - db.close(); - QCOMPARE(db.lastError().type(), QSqlError::NoError); - } -} void tst_QSqlQuery::oraOCINumber() { -- cgit v0.12 From d766d10bd57f131750e4ff522849e8648d2e3331 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 5 Dec 2011 12:37:37 +0200 Subject: Symbian: Only localize the application .rss that needs it, not all .rss Move LANG statement into proper RESOURCE block inside generated .mmp file, so it doesn't affect _reg.rss, which doesn't need to be localized. Task-number: ou1cimx1#947060 Reviewed-by: Pasi Pentikainen --- qmake/generators/symbian/symbiancommon.cpp | 1 - qmake/generators/symbian/symmake.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 8db82d6..c79bad2 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -397,7 +397,6 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, if (symbianLocalizationList.size()) { // Add localized resources to DEPLOYMENT if default resource deployment is done addLocalizedResourcesToDeployment("default_resource_deployment.files", symbianLocalizationList); - addLocalizedResourcesToDeployment("default_reg_deployment.files", symbianLocalizationList); } // deploy files specified by DEPLOYMENT variable diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 694bbfb..0b41572 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -681,6 +681,7 @@ void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, const Sy locTarget.append(".rss"); t << "SOURCEPATH\t\t\t. " << endl; + t << MMP_START_RESOURCE "\t\t" << locTarget << endl; t << "LANG SC "; // no endl SymbianLocalizationListIterator iter(symbianLocalizationList); while (iter.hasNext()) { @@ -688,7 +689,6 @@ void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, const Sy t << loc.symbianLanguageCode << " "; // no endl } t << endl; - t << MMP_START_RESOURCE "\t\t" << locTarget << endl; t << "HEADER" << endl; t << "TARGETPATH\t\t\t" RESOURCE_DIRECTORY_MMP << endl; t << MMP_END_RESOURCE << endl << endl; -- cgit v0.12 From 258bc6752b2896846ce757ffd8f71de16028a27b Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 7 Dec 2011 15:08:50 +0200 Subject: Symbian: Fix language mappings for localize_deployment Some Qt language codes now map to two Symbian language codes. Also added the missing en_in mapping. Task-number: ou1cimx1#947060 Reviewed-by: Pasi Pentikainen --- mkspecs/common/symbian/symbian.conf | 8 ++++++-- mkspecs/features/symbian/localize_deployment.prf | 5 +++-- qmake/generators/symbian/symbiancommon.cpp | 15 ++++++++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index c50dc77..4e9690d 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -155,7 +155,9 @@ SYMBIAN_SUPPORTED_LANGUAGES = \ pt_br en_ca fr_ca el_cy tr_cy \ en_tw en_hk en_cn en_jp en_th \ sv_fi zh_hk es_419 en_za fr_ch \ - de_ch it_ch zh_tw + de_ch it_ch zh_tw en_in + +SYMBIAN_LANGUAGES_WITH_TWO_CODES = ms id # These directories must match what configure uses for QT_INSTALL_PLUGINS and QT_INSTALL_IMPORTS QT_PLUGINS_BASE_DIR = /resource/qt$${QT_LIBINFIX}/plugins @@ -295,8 +297,10 @@ defineReplace(addLanguageDependentPkgItem) { pkgItem = $$eval($$1) pkgLanguageList = - for(dummyItem, SYMBIAN_MATCHED_LANGUAGES) { + for(matchedLanguage, SYMBIAN_MATCHED_LANGUAGES) { pkgLanguageList += "\"$$pkgItem\"" + # If the language has two mappings, add the item another time. + contains(SYMBIAN_LANGUAGES_WITH_TWO_CODES, $$matchedLanguage): pkgLanguageList += "\"$$pkgItem\"" } isEmpty(pkgLanguageList): pkgLanguageList = "\"$$pkgItem\"" diff --git a/mkspecs/features/symbian/localize_deployment.prf b/mkspecs/features/symbian/localize_deployment.prf index 3e7f585..57c3e93 100644 --- a/mkspecs/features/symbian/localize_deployment.prf +++ b/mkspecs/features/symbian/localize_deployment.prf @@ -28,7 +28,7 @@ SYMBIAN_LANG.he = 57 #Hebrew SYMBIAN_LANG.hi = 58 #Hindi SYMBIAN_LANG.hu = 17 #Hungarian SYMBIAN_LANG.is = 15 #Icelandic -SYMBIAN_LANG.id = 59 #Indonesian +SYMBIAN_LANG.id = 59 327 #Indonesian / Indonesian APAC SYMBIAN_LANG.ga = 60 #Irish SYMBIAN_LANG.it = 05 #Italian SYMBIAN_LANG.ja = 32 #Japanese @@ -39,7 +39,7 @@ SYMBIAN_LANG.lo = 66 #Laothian SYMBIAN_LANG.lv = 67 #Latvian SYMBIAN_LANG.lt = 68 #Lithuanian SYMBIAN_LANG.mk = 69 #Macedonian -SYMBIAN_LANG.ms = 70 #Malay +SYMBIAN_LANG.ms = 70 326 #Malay / Malay APAC SYMBIAN_LANG.ml = 71 #Malayalam SYMBIAN_LANG.mr = 72 #Marathi SYMBIAN_LANG.mo = 73 #Moldavian @@ -88,6 +88,7 @@ SYMBIAN_LANG.en_hk = 158 #English as appropriate for use in Hong Kong SYMBIAN_LANG.en_cn = 159 #English as appropriate for use in the Peoples Republic of China SYMBIAN_LANG.en_jp = 160 #English as appropriate for use in Japan SYMBIAN_LANG.en_th = 161 #English as appropriate for use in Thailand +SYMBIAN_LANG.en_in = 230 #English as appropriate for use in India SYMBIAN_LANG.sv_fi = 85 #Finland Swedish SYMBIAN_LANG.zh_hk = 30 #HongKong Chinese SYMBIAN_LANG.es_419 = 83 #Latin American Spanish diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index c79bad2..e2dec40 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -864,12 +864,17 @@ void SymbianCommonGenerator::fillQt2SymbianLocalizationList(SymbianLocalizationL QStringList symbianLanguages = generator->project->values("SYMBIAN_MATCHED_LANGUAGES"); foreach (QString qtCode, symbianLanguages) { - SymbianLocalization newLoc; QString symbianCodeVariable = symbianCodePrefix + qtCode; - newLoc.symbianLanguageCode = generator->project->first(symbianCodeVariable); - if (!newLoc.symbianLanguageCode.isEmpty()) { - newLoc.qtLanguageCode = qtCode; - symbianLocalizationList->append(newLoc); + QStringList symbianCodes = generator->project->values(symbianCodeVariable); + // Some languages have more than one Symbian code, so they get more than one + // entry in symbianLocalizationList. + foreach (QString symbianCode, symbianCodes) { + SymbianLocalization newLoc; + newLoc.symbianLanguageCode = symbianCode; + if (!newLoc.symbianLanguageCode.isEmpty()) { + newLoc.qtLanguageCode = qtCode; + symbianLocalizationList->append(newLoc); + } } } } -- cgit v0.12 From 10cce072be3619bfce802e0aae70e043437a1e79 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Thu, 8 Dec 2011 13:31:02 +0100 Subject: Updated WebKit to 83439de78841f9569ad78e3a84b7b888337b5d18 --- src/3rdparty/webkit/.tag | 2 +- src/3rdparty/webkit/ChangeLog | 8 ++++++++ src/3rdparty/webkit/Source/WebCore/ChangeLog | 9 +++++++++ src/3rdparty/webkit/Source/WebCore/WebCore.pri | 2 +- .../webkit/Source/WebCore/inspector/InspectorWorkerAgent.cpp | 4 ++-- src/3rdparty/webkit/Source/WebKit.pri | 2 +- src/3rdparty/webkit/VERSION | 2 +- 7 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index 12a28b8..3868886 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -52a11cec052aa40d3bbc06861be1177b649b4a99 +83439de78841f9569ad78e3a84b7b888337b5d18 diff --git a/src/3rdparty/webkit/ChangeLog b/src/3rdparty/webkit/ChangeLog index bbaf26d..82dc1fb 100644 --- a/src/3rdparty/webkit/ChangeLog +++ b/src/3rdparty/webkit/ChangeLog @@ -1,3 +1,11 @@ +2011-12-08 Zeno Albisser + + Disable -Werror for standalone packages. + + Reviewed by Simon Hausmann. + + * Source/WebKit.pri: + 2011-11-09 Zeno Albisser [Qt] Unreviewed: Fix build on Mac. diff --git a/src/3rdparty/webkit/Source/WebCore/ChangeLog b/src/3rdparty/webkit/Source/WebCore/ChangeLog index ead97bd..4c6a7c1 100755 --- a/src/3rdparty/webkit/Source/WebCore/ChangeLog +++ b/src/3rdparty/webkit/Source/WebCore/ChangeLog @@ -1,3 +1,12 @@ +2011-06-10 Konstantin Tokarev + + Reviewed by Joseph Pecoraro. + + Fixed build with enabled workers and disabled inspector + https://bugs.webkit.org/show_bug.cgi?id=62461 + + * inspector/InspectorWorkerAgent.cpp: Added inspector guard + 2011-11-01 Zeno Albisser [Qt] bad codegen, pointer diff in JSC::JSCallbackConstructor::JSCallbackConstructor diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pri b/src/3rdparty/webkit/Source/WebCore/WebCore.pri index d8ba8a6..00357a1 100644 --- a/src/3rdparty/webkit/Source/WebCore/WebCore.pri +++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pri @@ -153,7 +153,7 @@ symbian { CONFIG += do_not_build_as_thumb CONFIG(release, debug|release): QMAKE_CXXFLAGS.ARMCC += -OTime -O3 - # Symbian plugin support. + # Symbian plugin support LIBS += -lefsrv !CONFIG(QTDIR_build) { diff --git a/src/3rdparty/webkit/Source/WebCore/inspector/InspectorWorkerAgent.cpp b/src/3rdparty/webkit/Source/WebCore/inspector/InspectorWorkerAgent.cpp index b875f0f..6288a88 100644 --- a/src/3rdparty/webkit/Source/WebCore/inspector/InspectorWorkerAgent.cpp +++ b/src/3rdparty/webkit/Source/WebCore/inspector/InspectorWorkerAgent.cpp @@ -30,7 +30,7 @@ #include "config.h" -#if ENABLE(WORKERS) +#if ENABLE(WORKERS) && ENABLE(INSPECTOR) #include "InspectorWorkerAgent.h" @@ -128,4 +128,4 @@ void InspectorWorkerAgent::didStartWorkerContext(WorkerContextProxy* workerConte } // namespace WebCore -#endif // ENABLE(WORKERS) +#endif // ENABLE(WORKERS) && ENABLE(INSPECTOR) diff --git a/src/3rdparty/webkit/Source/WebKit.pri b/src/3rdparty/webkit/Source/WebKit.pri index c469d1a..5080119 100644 --- a/src/3rdparty/webkit/Source/WebKit.pri +++ b/src/3rdparty/webkit/Source/WebKit.pri @@ -102,7 +102,7 @@ CONFIG -= warn_on # Treat warnings as errors on x86/Linux/GCC linux-g++* { - isEqual(QT_ARCH,x86_64)|isEqual(QT_ARCH,i386): QMAKE_CXXFLAGS += -Werror + !CONFIG(standalone_package):isEqual(QT_ARCH,x86_64)|isEqual(QT_ARCH,i386): QMAKE_CXXFLAGS += -Werror greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 5) { if (!contains(QMAKE_CXXFLAGS, -std=c++0x) && !contains(QMAKE_CXXFLAGS, -std=gnu++0x)) { diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 750e7e7..a08cc05 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - 52a11cec052aa40d3bbc06861be1177b649b4a99 + 83439de78841f9569ad78e3a84b7b888337b5d18 -- cgit v0.12