From b0792a5c548c600443edbeaa3c4b0612e0eb4045 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 24 Sep 2010 09:25:26 +0200 Subject: Doc: Implementing new search display --- doc/src/template/scripts/functions.js | 223 ++++++++++++++++------------ tools/qdoc3/test/qt-html-templates.qdocconf | 9 +- 2 files changed, 138 insertions(+), 94 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index faa4ca4..5bf8323 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -1,38 +1,57 @@ +// Removing search results +function hideSearchResults() { + $('#resultdialog').removeClass('active'); + $("#resultlist").removeClass().addClass('all'); + $("#resultlinks").removeClass().addClass('all'); + $("#searchcount").removeClass().addClass('all'); +} +// Closing search result box +$('#resultclose').click(function(e) { + e.preventDefault(); + hideSearchResults(); +}); + +$(document.body).click(function() { +}); + /* START non link areas where cursor should change to pointing hand */ $('.t_button').mouseover(function() { $('.t_button').css('cursor','pointer'); - /*document.getElementById(this.id).style.cursor='pointer';*/ }); /* END non link areas */ +// Font size small $('#smallA').click(function() { - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller'); + $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','smaller'); $('.t_button').removeClass('active') $(this).addClass('active') }); +// Font size reset $('#medA').click(function() { - $('.content .heading').css('font','600 16px/1 Arial'); - $('.content h1').css('font','600 18px/1.2 Arial'); - $('.content h2').css('font','600 16px/1.2 Arial'); - $('.content h3').css('font','600 14px/1.2 Arial'); - $('.content p').css('font','13px/20px Verdana'); - $('.content li').css('font','400 13px/1 Verdana'); - $('.content li').css('line-height','14px'); - $('.content .toc li').css('font', 'normal 10px/1.2 Verdana'); - $('.content table').css('font','13px/1.2 Verdana'); - $('.content .heading').css('font','600 16px/1 Arial'); - $('.content .indexboxcont li').css('font','600 13px/1 Verdana'); + $('.mainContent .heading').css('font','600 16px/1 Arial'); + $('.mainContent h1').css('font','600 18px/1.2 Arial'); + $('.mainContent h2').css('font','600 16px/1.2 Arial'); + $('.mainContent h3').css('font','600 14px/1.2 Arial'); + $('.mainContent p').css('font','13px/20px Verdana'); + $('.mainContent li').css('font','400 13px/1 Verdana'); + $('.mainContent li').css('line-height','14px'); + $('.mainContent .toc li').css('font', 'normal 10px/1.2 Verdana'); + $('.mainContent table').css('font','13px/1.2 Verdana'); + $('.mainContent .heading').css('font','600 16px/1 Arial'); + $('.mainContent .indexboxcont li').css('font','600 13px/1 Verdana'); $('.t_button').removeClass('active') $(this).addClass('active') }); +// Font size large $('#bigA').click(function() { - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','large'); - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('line-height','25px'); + $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','large'); + $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('line-height','25px'); $('.t_button').removeClass('active') $(this).addClass('active') }); +// Show page content after closing feedback box $('.feedclose').click(function() { $('.bd').show(); $('.hd').show(); @@ -41,6 +60,7 @@ $('.feedclose').click(function() { $('#blurpage').hide(); }); +// Hide page content and show feedback box $('.feedback').click(function() { $('.bd').hide(); $('.hd').hide(); @@ -48,71 +68,93 @@ $('.feedback').click(function() { $('#feedbackBox').show(); $('#blurpage').show(); }); -var lookupCount = 0; -var articleCount = 0; -var exampleCount = 0; -var qturl = ""; // change from "http://doc.qt.nokia.com/4.6/" to 0 so we can have relative links +// Setting URL - in this case relative to root +var qturl = ""; + +// Process data sent back from the server. The data is structured as a XML. +/* +XML structure handled by function processNokiaData() + - container for each page returned + - contains keywords + - contains page title/header content + - contains page URL - URL relative to root + - contains page type - APIPage/Article/Example + +*/ + function processNokiaData(response){ var propertyTags = response.getElementsByTagName('page'); - for (var i=0; i< propertyTags.length; i++) { - var linkStart = "
  • " + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd; - $('#ul001').append(full_li_element); - $('#ul001 .defaultLink').css('display','none'); - - } - } - - if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){ - articleCount++; - - for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ - full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; - full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - - $('#ul002').append(full_li_element); - $('#ul002 .defaultLink').css('display','none'); - - } - } - if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){ - exampleCount++; - - - for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ - full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; - full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - - $('#ul003').append(full_li_element); - $('#ul003 .defaultLink').css('display','none'); - - } - } - if(i==propertyTags.length){$('#pageType').removeClass('loading');} - - } - if(lookupCount > 0){$('#ul001 .menuAlert').remove();$('#ul001').prepend('
  • Found ' + lookupCount + ' hits
  • ');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');} - if(articleCount > 0){$('#ul002 .menuAlert').remove();$('#ul002').prepend('
  • Found ' + articleCount + ' hits
  • ');$('#ul002 li').css('display','block');} - if(exampleCount > 0){$('#ul003 .menuAlert').remove();$('#ul003').prepend('
  • Found ' + articleCount + ' hits
  • ');$('#ul003 li').css('display','block');} - - if(lookupCount == 0){$('#ul001 .menuAlert').remove();$('#ul001').prepend('
  • Found no result
  • ');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');} - if(articleCount == 0){$('#ul002 .menuAlert').remove();$('#ul002').prepend('
  • Found no result
  • ');$('#ul002 li').css('display','block');} - if(exampleCount == 0){$('#ul003 .menuAlert').remove();$('#ul003').prepend('
  • Found no result
  • ');$('#ul003 li').css('display','block');} - // reset count variables; - lookupCount=0; - articleCount = 0; - exampleCount = 0; + var apiCount = 0; + var articleCount = 0; + var exampleCount = 0; + var full_li_element; + + $('#resultlist li').remove(); + + + for (var i=0; i'; + $('#resultlist').append(full_li_element); + } + } + + if (propertyTags.length > 0) { + $('#resultdialog').addClass('active'); + $('#resultcount').html(propertyTags.length); + $('#apicount').html(apiCount); + $('#articlecount').html(articleCount); + $('#examplecount').html(exampleCount); + } + + // Filtering results in display + $('p#resultlinks a').click(function(e) { + e.preventDefault(); + // Displays API ref pages + if (this.id == "showapiresults") { + $("#resultlist").removeClass().addClass('api'); + $("#resultlinks").removeClass().addClass('api'); + $("#searchcount").removeClass().addClass('api'); + } + // Displays Articles + else if (this.id == "showarticleresults") { + $("#resultlist").removeClass().addClass('article'); + $("#resultlinks").removeClass().addClass('article'); + $("#searchcount").removeClass().addClass('article'); + } + // Displays Examples + if (this.id == "showexampleresults") { + $("#resultlist").removeClass().addClass('example'); + $("#resultlinks").removeClass().addClass('example'); + $("#searchcount").removeClass().addClass('example'); + } + // Displays All + if (this.id == "showallresults") { + $("#resultlist").removeClass().addClass('all'); + $("#resultlinks").removeClass().addClass('all'); + $("#searchcount").removeClass().addClass('all'); + } + }); } + //build regular expression object to find empty string or any number of blank var blankRE=/^\s*$/; function CheckEmptyAndLoadList() @@ -129,27 +171,22 @@ function CheckEmptyAndLoadList() var value = document.getElementById('pageType').value; if((blankRE.test(value)) || (value.length < 3)) { - //empty inputbox - // load default li elements into the ul if empty - // loadAllList(); // replaced + + + $('.defaultLink').css('display','block'); - // $('.liveResult').css('display','none'); + + $('#resultdialog').removeClass('active'); + $('#resultlist li').remove(); }else{ - $('.defaultLink').css('display','none'); + } } -/* -$(window).resize(function(){ -if($(window).width()<400) - $('body').addClass('offline'); -else - $('body').removeClass('offline'); - }); - */ -// Loads on doc ready + +// Loads on doc ready - prepares search $(document).ready(function () { - //alert(pageUrl); - //$('#pageUrl').attr('foo',pageUrl); + + var pageTitle = $('title').html(); var currentString = $('#pageType').val() ; if(currentString.length < 1){ @@ -165,14 +202,14 @@ else $('.searching').remove(); CheckEmptyAndLoadList(); $('.report').remove(); - // debug$('.content').prepend('
  • too short or blank
  • '); // debug + return; } if (this.timer) clearTimeout(this.timer); this.timer = setTimeout(function () { $('#pageType').addClass('loading'); $('.searching').remove(); - $('.list ul').prepend(''); + $.ajax({ contentType: "application/x-www-form-urlencoded", url: 'http://' + location.host + '/nokiasearch/GetDataServlet', @@ -184,7 +221,7 @@ else $('.liveResult').remove(); $('.searching').remove(); $('#pageType').removeClass('loading'); - $('.list ul').prepend(''); + processNokiaData(response); } diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 44aa918..0d6cb8d 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -71,6 +71,13 @@ HTML.postheader = "
    \n" \ "
    \n" \ "
    \n" \ " \n" \ + "
    \n" \ + " Close \n" \ + "

    All | API | Articles | Examples

    \n" \ + "

     results:

    \n" \ + "
      \n" \ + "
    \n" \ + "
    \n" \ "
    \n" \ "
    \n" \ "
    \n" \ @@ -135,7 +142,7 @@ HTML.postpostheader = " \n" \ " \n" \ " \n" \ " \n" \ - "
    \n" + "
    \n" HTML.footer = "" \ "
    \n" \ -- cgit v0.12 From 38449f8700da5c673b95a394cf9b7543904cb10c Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 28 Sep 2010 00:03:43 +0300 Subject: Reference to QStringList::find() is incorrect, should be QStringList::filter(). Task-number: QTBUG-9248 --- src/corelib/tools/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 5be885b..dba53af 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -565,7 +565,7 @@ const QString::Null QString::null = { }; and join a list of strings into a single string with an optional separator using QStringList::join(). You can obtain a list of strings from a string list that contain a particular substring or - that match a particular QRegExp using the QStringList::find() + that match a particular QRegExp using the QStringList::filter() function. : \section1 Querying String Data -- cgit v0.12 From 5b7c9baea08125a51e7ecb318e4579f0fe4eef0c Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 28 Sep 2010 00:04:34 +0300 Subject: Remove obsolete reference to qregexp.tex. According to history, this file hasn't really been maintained since 3.x times, and hasn't existed in the source tree for quite a while. --- src/corelib/tools/qregexp.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 36827d0..a8bf38f 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -74,10 +74,6 @@ int qFindString(const QChar *haystack, int haystackLen, int from, #define RXERR_INTERVAL QT_TRANSLATE_NOOP("QRegExp", "invalid interval") #define RXERR_CATEGORY QT_TRANSLATE_NOOP("QRegExp", "invalid category") -/* - WARNING! Be sure to read qregexp.tex before modifying this file. -*/ - /*! \class QRegExp \reentrant -- cgit v0.12 From 59949ff908995158462d456c14d4a3a10b19418e Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 28 Sep 2010 01:43:36 +0300 Subject: Fix a link that no longer exists in documentation. Best to keep them up to date, even though that link isn't really used for anything except to make a point. Task-number: QTWEBSITE-13 --- src/corelib/global/qnamespace.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 5cd7f0e..87af61a 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2767,7 +2767,7 @@ \value ElideNone Ellipsis should NOT appear in the text. Qt::ElideMiddle is normally the most appropriate choice for URLs (e.g., - "\l{http://qt.nokia.com/careers/movingto/brisbane/}{http://qt.nok...ovingto/brisbane/}"), + "\l{http://bugreports.qt.nokia.com/browse/QTWEBSITE-13}{http://bugreports.qt.../QTWEBSITE-13/}"), whereas Qt::ElideRight is appropriate for other strings (e.g., "\l{http://qt.nokia.com/doc/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}"). -- cgit v0.12 From a21b6be2e97b2678111930bc04eaa843b42fa22b Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Tue, 28 Sep 2010 11:39:38 +0200 Subject: Doc: Added lisence header to snippet --- doc/src/snippets/widgetprinting.cpp | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/doc/src/snippets/widgetprinting.cpp b/doc/src/snippets/widgetprinting.cpp index b3d5b7c..47839d8 100644 --- a/doc/src/snippets/widgetprinting.cpp +++ b/doc/src/snippets/widgetprinting.cpp @@ -1,3 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ #include -- cgit v0.12 From d462d0af6fd4ad2fa21ab2f5364754fcb1a9af50 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 28 Sep 2010 11:45:59 +0200 Subject: Doc: fixing bugs in slim-fit style --- doc/src/template/style/narrow.css | 6 +++--- tools/qdoc3/test/qt-html-templates.qdocconf | 31 ----------------------------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index de5b0a0..00d28b9 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -6,7 +6,7 @@ } .narrow a { - color: #44a51c; + color: #00732f; } .narrow .header, .narrow .header .content, .narrow .footer, .narrow .wrapper { @@ -45,7 +45,7 @@ { width: auto; height: auto; - color: #363534; + color: #00732f; position: static; float: left; margin-left: 25px; @@ -163,7 +163,7 @@ } .narrow .wrap .breadcrumb ul li a { - color: #44a51c; + color: #00732f; } .narrow .wrap .breadcrumb ul li.last a { diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 44aa918..9609714 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -26,37 +26,6 @@ HTML.postheader = "
    \n" \ " \n" \ " \n" \ "
    \n" \ - " \n" \ "
    \n" \ "
    \n" \ "
    \n" \ -- cgit v0.12 From 5b053a355a6186fdcfa26d3337ad9eaebce00b01 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 28 Sep 2010 13:15:27 +0200 Subject: Doc: add style to new search results --- doc/src/template/style/style.css | 80 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 614e296..c172e23 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -528,6 +528,8 @@ height:21px; padding:2px 0 0 5px; width:167px; + _height: 23px; + _width: 169px; } .sidebar .search form input#pageType @@ -645,6 +647,81 @@ .floatingResult:hover{ } + + #resultdialog { + display: none; + position: absolute; + *left: 30px; + _left: 0; + *top: 35px; + _top: 30px; + _zoom: 1; + background-color: #fff; + border: 1px solid #666; + z-index: 4; + margin-top: 5px; + _margin: 0 0 0 -20px; + padding: 10px; + width: 220px; + _width: 196px; + height: 250px; + overflow: auto; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + border-radius: .5em; + -webkit-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + -moz-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + } + + #resultdialog.active { + display: block; + } + + #resultdialog #resultclose { + float: right; + } + + #resultdialog p, + #resultdialog ul { + clear: both; + margin: 3px 0; + } + + p#searchcount span { + display: none; + } + + p#searchcount.all span#resultcount, + p#searchcount.api span#apicount, + p#searchcount.article span#articlecount, + p#searchcount.example span#examplecount { + display: inline; + } + + #resultlist li { + display: none; + } + + #resultlist.api li.api, + #resultlist.article li.article, + #resultlist.example li.example, + #resultlist.all li { + display: block; + } + + #resultlinks.api a#showapiresults, + #resultlinks.api a#showapiresults:hover, + #resultlinks.article a#showarticleresults, + #resultlinks.article a#showarticleresults:hover, + #resultlinks.example a#showexampleresults, + #resultlinks.example a#showexampleresults:hover, + #resultlinks.all a#showallresults, + #resultlinks.all a#showallresults:hover { + color: #B0ADAB; + } + + /* end sidebar elements */ /* content elements */ .wrap @@ -1344,7 +1421,8 @@ .creator .wrapper .hd, .creator .wrapper .ft, .creator .sidebar, - .creator .wrap .feedback + .creator .wrap .feedback, + .creator #resultdialog { display:none; } -- cgit v0.12 From 148e78525f76d3d716fd98af2a018cd08da541ab Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 28 Sep 2010 13:44:19 +0200 Subject: Doc: fixing slim fit style - search box. --- doc/src/template/style/narrow.css | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index 00d28b9..8e42a0d 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -203,11 +203,7 @@ *border: 1px solid #fff; *height: 17px; _height: 18px; - /* to be fixed */ - display: none; - /* to be fixed */ } - .narrow .indexbox .indexIcon { display: none; } @@ -268,3 +264,6 @@ } /* end narrow mode */ + .creator #narrowsearch, .creator #narrowmenu{ + display:none; + } -- cgit v0.12 From 8c65dc25962e167237c2573979b1dfff88c29326 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Wed, 29 Sep 2010 16:05:51 +0200 Subject: Doc: Implementing new doc search dialog. Removing search results from menus and including them in a floating dialog div element --- doc/src/template/scripts/functions.js | 87 ++++++++++++++++----------- doc/src/template/scripts/narrow.js | 108 ++++++++++++++++++++++++---------- doc/src/template/style/style.css | 45 +++++++------- 3 files changed, 152 insertions(+), 88 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 5bf8323..0bb88a8 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -1,11 +1,12 @@ // Removing search results function hideSearchResults() { +/* hiding search results as the user clicks on the different categories */ $('#resultdialog').removeClass('active'); $("#resultlist").removeClass().addClass('all'); $("#resultlinks").removeClass().addClass('all'); $("#searchcount").removeClass().addClass('all'); } -// Closing search result box +/* closing the searhc result dialog */ $('#resultclose').click(function(e) { e.preventDefault(); hideSearchResults(); @@ -19,14 +20,14 @@ $('.t_button').mouseover(function() { $('.t_button').css('cursor','pointer'); }); /* END non link areas */ -// Font size small +/* Changing font size to smaller */ $('#smallA').click(function() { $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','smaller'); $('.t_button').removeClass('active') $(this).addClass('active') }); -// Font size reset +/* Reset font size */ $('#medA').click(function() { $('.mainContent .heading').css('font','600 16px/1 Arial'); $('.mainContent h1').css('font','600 18px/1.2 Arial'); @@ -42,8 +43,7 @@ $('#medA').click(function() { $('.t_button').removeClass('active') $(this).addClass('active') }); - -// Font size large +/* Changing font size to bigger */ $('#bigA').click(function() { $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','large'); $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('line-height','25px'); @@ -51,7 +51,7 @@ $('#bigA').click(function() { $(this).addClass('active') }); -// Show page content after closing feedback box +/* Show page content after closing feedback box */ $('.feedclose').click(function() { $('.bd').show(); $('.hd').show(); @@ -60,7 +60,7 @@ $('.feedclose').click(function() { $('#blurpage').hide(); }); -// Hide page content and show feedback box +/* Hide page content and show feedback box */ $('.feedback').click(function() { $('.bd').hide(); $('.hd').hide(); @@ -68,9 +68,11 @@ $('.feedback').click(function() { $('#feedbackBox').show(); $('#blurpage').show(); }); -// Setting URL - in this case relative to root +/* Default search URL */ var qturl = ""; +/* The next function handles the response data (in xml) returned by the search engine */ + // Process data sent back from the server. The data is structured as a XML. /* XML structure handled by function processNokiaData() @@ -84,47 +86,62 @@ XML structure handled by function processNokiaData() function processNokiaData(response){ +/* fetch the responce from the server using page as the root element */ var propertyTags = response.getElementsByTagName('page'); - - var apiCount = 0; + /* reset counters */ + var lookupCount = 0; var articleCount = 0; var exampleCount = 0; - var full_li_element; +/* remove any old results */ $('#resultlist li').remove(); + /* running through the elements in the xml structure */ for (var i=0; i'; - $('#resultlist').append(full_li_element); - } + /* adding the URL attribute*/ + full_li_element += propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; + /* adding the link title and closing the link and list elements */ + full_li_element += '">' + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + ''; + /* appending the list element to the #resultlist div*/ + $('#resultlist').append(full_li_element); + } } + /* if the result is not empty */ if (propertyTags.length > 0) { + /* add class name active to show the dialog */ $('#resultdialog').addClass('active'); + /* setting number of hits*/ $('#resultcount').html(propertyTags.length); $('#apicount').html(apiCount); $('#articlecount').html(articleCount); $('#examplecount').html(exampleCount); } + // Filtering results in display $('p#resultlinks a').click(function(e) { e.preventDefault(); @@ -157,8 +174,11 @@ function processNokiaData(response){ //build regular expression object to find empty string or any number of blank var blankRE=/^\s*$/; + + function CheckEmptyAndLoadList() { + /* Start Extracting information for feedback and adding this to the feedback form */ var pageUrl = window.location.href; var pageVal = $('title').html(); $('#feedUrl').remove(); @@ -166,50 +186,52 @@ function CheckEmptyAndLoadList() $('.menuAlert').remove(); $('#feedform').append(''); $('#feedform').append(''); - $('.liveResult').remove(); - $('.defaultLink').css('display','block'); + /* End Extracting information for feedback and adding this to the feedback form */ + + /* extracts search query */ var value = document.getElementById('pageType').value; + /* if the search is less than three chars long remove class names and remove elements from old search*/ if((blankRE.test(value)) || (value.length < 3)) { - - - - $('.defaultLink').css('display','block'); - $('#resultdialog').removeClass('active'); $('#resultlist li').remove(); - }else{ - } } // Loads on doc ready - prepares search $(document).ready(function () { - - + /* fetch page title*/ var pageTitle = $('title').html(); + /* getting content from search box */ var currentString = $('#pageType').val() ; + /* if the search box is not empty run CheckEmptyAndLoadList*/ if(currentString.length < 1){ - $('.defaultLink').css('display','block'); CheckEmptyAndLoadList(); } + /* on key-up in the search box execute the following */ $('#pageType').keyup(function () { + /* extract the search box content */ var searchString = $('#pageType').val() ; + /* if the string is less than three characters */ if ((searchString == null) || (searchString.length < 3)) { + /* remove classes and elements*/ $('#pageType').removeClass('loading'); - $('.liveResult').remove(); $('.searching').remove(); + /* run CheckEmptyAndLoadList */ CheckEmptyAndLoadList(); - $('.report').remove(); + $('.report').remove(); return; } + /* if timer checks out */ if (this.timer) clearTimeout(this.timer); this.timer = setTimeout(function () { + /* add loading image by adding loading class */ $('#pageType').addClass('loading'); $('.searching').remove(); + /* run the actual search */ $.ajax({ contentType: "application/x-www-form-urlencoded", url: 'http://' + location.host + '/nokiasearch/GetDataServlet', @@ -217,8 +239,7 @@ function CheckEmptyAndLoadList() dataType:'xml', type: 'post', success: function (response, textStatus) { - - $('.liveResult').remove(); + /* on success remove loading img */ $('.searching').remove(); $('#pageType').removeClass('loading'); @@ -226,6 +247,6 @@ function CheckEmptyAndLoadList() } }); - }, 500); + }, 500); /* timer set to 500 ms */ }); - }); + }); \ No newline at end of file diff --git a/doc/src/template/scripts/narrow.js b/doc/src/template/scripts/narrow.js index 35c81bf..a5e8b97 100644 --- a/doc/src/template/scripts/narrow.js +++ b/doc/src/template/scripts/narrow.js @@ -1,17 +1,15 @@ +/* This function generates menus and search box in narrow/slim fit mode */ var narrowInit = function() { - /* TODO: - Could probably be more efficient, not hardcoding each element to be created - */ - // 1: Create search form + /* 1: Create search form */ var narrowSearch = $('
    '); var searchform = $("#qtdocsearch"); narrowSearch.append(searchform); $("#qtdocheader .content .qtref").after(narrowSearch); - // 2: Create dropdowns + /* 2: Create dropdowns */ var narrowmenu = $('
      '); - // Lookup + /* Lookup */ var lookuptext = $("#lookup h2").attr("title"); $("#lookup ul").removeAttr("id"); $("#lookup ul li").removeAttr("class"); @@ -24,7 +22,7 @@ var narrowInit = function() { lookuplist.append(lookupul); narrowmenu.append(lookuplist); - // Topics + /* Topics */ var topicstext = $("#topics h2").attr("title"); $("#topics ul").removeAttr("id"); $("#topics ul li").removeAttr("class"); @@ -37,7 +35,7 @@ var narrowInit = function() { topicslist.append(topicsul); narrowmenu.append(topicslist); - // Examples + /* Examples */ var examplestext = $("#examples h2").attr("title"); $("#examples ul").removeAttr("id"); $("#examples ul li").removeAttr("class"); @@ -58,32 +56,78 @@ var narrowInit = function() { }); } +/* Executes on doc ready */ $(document).ready(function(){ -/* if ($('body').hasClass('narrow')) { - narrowInit(); - } - */ - if($(window).width()<600) { - $('body').addClass('narrow'); - - if ($("#narrowsearch").length == 0) { - narrowInit(); - } - } - else { - $('body').removeClass('narrow'); + /* check if body has the narrow class */ + if ($('body').hasClass('narrow')) { + /* run narrowInit */ + narrowInit(); + } + + /* messure window width and add class if it is smaller than 600 px */ + if($(window).width()<600) { + $('body').addClass('narrow'); + /* if the search box contains */ + if ($("#narrowsearch").length == 0) { + /* run narrowInit */ + narrowInit(); + } + } + else { /* if the window is wider than 600 px, narrow is removed */ + $('body').removeClass('narrow'); + if ($("#narrowsearch").length == 0) { + } + } +}); +/* binding resize event to this funciton */ +$(window).bind('resize', function () { + /* if the window is wider than 600 px, narrow class is added */ + if($(window).width()<600) { + $('body').addClass('narrow'); + if ($("#narrowsearch").length == 0) { + narrowInit(); + } + } + else { + /* else we remove the narrow class */ + $('body').removeClass('narrow'); } }); -$(window).bind('resize', function () { - if($(window).width()<600) { - $('body').addClass('narrow'); + $('#narrowsearch').keyup(function () { + /* extract the search box content */ + var searchString = $('#narrowsearch').val(); + /* if the string is less than three characters */ + if ((searchString == null) || (searchString.length < 3)) { + /* remove classes and elements*/ + $('#narrowsearch').removeClass('loading'); + $('.searching').remove(); + /* run CheckEmptyAndLoadList */ + CheckEmptyAndLoadList(); + + $('.report').remove(); + return; + } + /* if timer checks out */ + if (this.timer) clearTimeout(this.timer); + this.timer = setTimeout(function () { + /* add loading image by adding loading class */ + $('#narrowsearch').addClass('loading'); + $('.searching').remove(); - if ($("#narrowsearch").length == 0) { - narrowInit(); - } - } - else { - $('body').removeClass('narrow'); - } -}); \ No newline at end of file + /* run the actual search */ + $.ajax({ + contentType: "application/x-www-form-urlencoded", + url: 'http://' + location.host + '/nokiasearch/GetDataServlet', + data: 'searchString='+searchString, + dataType:'xml', + type: 'post', + success: function (response, textStatus) { + /* on success remove loading img */ + $('.searching').remove(); + $('#narrowsearch').removeClass('loading'); + processNokiaData(response); + } + }); + }, 500); /* timer set to 500 ms */ + }); \ No newline at end of file diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index c172e23..5833266 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -528,8 +528,6 @@ height:21px; padding:2px 0 0 5px; width:167px; - _height: 23px; - _width: 169px; } .sidebar .search form input#pageType @@ -629,25 +627,11 @@ background:url("../images/spinner.gif") no-repeat scroll right center transparent; } -.floatingResult{ - z-index:1; - position:relative; - padding-top:0px; - background-color:white; - border:solid 1px black; - height:250px; - width:600px; - overflow-x:hidden; - overflow-y:auto; -} - - .floatingResult:hover{ - display:block; - } - .floatingResult:hover{ + .sidebar .search form { + _height: 23px; + _width: 169px; } - - + #resultdialog { display: none; position: absolute; @@ -720,7 +704,23 @@ #resultlinks.all a#showallresults:hover { color: #B0ADAB; } - + .floatingResult{ + z-index:1; + position:relative; + padding-top:0px; + background-color:white; + border:solid 1px black; + height:250px; + width:600px; + overflow-x:hidden; + overflow-y:auto; + } + + .floatingResult:hover{ + display:block; + } + .floatingResult:hover{ + } /* end sidebar elements */ /* content elements */ @@ -1421,8 +1421,7 @@ .creator .wrapper .hd, .creator .wrapper .ft, .creator .sidebar, - .creator .wrap .feedback, - .creator #resultdialog + .creator .wrap .feedback { display:none; } -- cgit v0.12 From 976391c5ce2bbe3b992298e140bbbbc596ca756f Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Fri, 1 Oct 2010 17:18:39 +1000 Subject: Update change log. --- dist/changes-4.7.1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.7.1 b/dist/changes-4.7.1 index 2d79ac1..68b23ba 100644 --- a/dist/changes-4.7.1 +++ b/dist/changes-4.7.1 @@ -109,7 +109,11 @@ QtDBus QtMultimedia ------------ - + - QAudioOutput + * [QTBUG-11586] Support audio with more than two channels. + * [QTBUG-11755] Fixed outputing audio in push mode with ALSA. + * [QTBUG-11883] Fixed segmentation fault when closing a QAudioInput or + QAudioOutput. QtNetwork --------- -- cgit v0.12 From 55bf3ab3fb5591544e1f6a7996d5fdedb8e699c9 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 1 Oct 2010 11:25:02 +0300 Subject: Remove partial upgrade deployment generation for Webkit Generic partial upgrade package deployment generation in qbase.pri wrecks webkit pkg files. Reviewed-by: axis --- src/qbase.pri | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/qbase.pri b/src/qbase.pri index b431ade..e565e4a 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -185,18 +185,21 @@ include(qt_targets.pri) win32:DEFINES+=_USE_MATH_DEFINES symbian { - # Partial upgrade SIS file - vendorinfo = \ - "; Localised Vendor name" \ - "%{\"Nokia, Qt\"}" \ - " " \ - "; Unique Vendor name" \ - ":\"Nokia, Qt\"" \ - " " - pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \ - "$${LITERAL_HASH}{\"$${TARGET}\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" - partial_upgrade.pkg_prerules = pu_header vendorinfo - partial_upgrade.sources = $$QMAKE_LIBDIR_QT/$${TARGET}.dll - partial_upgrade.path = c:/sys/bin - DEPLOYMENT += partial_upgrade + # Make partial upgrade SIS file for all dll's except webkit + !contains(TARGET.UID3, 0x200267C2):!contains(TARGET.UID3, 0xE00267C2) { + # Partial upgrade SIS file + vendorinfo = \ + "; Localised Vendor name" \ + "%{\"Nokia, Qt\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia, Qt\"" \ + " " + pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \ + "$${LITERAL_HASH}{\"$${TARGET}\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" + partial_upgrade.pkg_prerules = pu_header vendorinfo + partial_upgrade.sources = $$QMAKE_LIBDIR_QT/$${TARGET}.dll + partial_upgrade.path = c:/sys/bin + DEPLOYMENT += partial_upgrade + } } -- cgit v0.12 From e4407012815a805d9a7d1a3beb7038a93cdd74dd Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 1 Oct 2010 10:35:46 +0200 Subject: Make the OpenSSL library search also hit /lib. Task-number: http://bugs.meego.com/show_bug.cgi?id=7777 Reviewed-by: Markus Goetz --- src/network/ssl/qsslsocket_openssl_symbols.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 6affa36..d717214 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -333,7 +333,7 @@ static QStringList findAllLibSsl() paths = QString::fromLatin1(qgetenv("LD_LIBRARY_PATH")) .split(QLatin1Char(':'), QString::SkipEmptyParts); # endif - paths << QLatin1String("/usr/lib") << QLatin1String("/usr/local/lib"); + paths << QLatin1String("/lib") << QLatin1String("/usr/lib") << QLatin1String("/usr/local/lib"); QStringList foundSsls; foreach (const QString &path, paths) { -- cgit v0.12 From 4ee6f86baccd7c5ba065fd00d22120e71e1f6d3a Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 1 Oct 2010 12:08:24 +0200 Subject: Incorrect selection background for unfocused widgets with GTK In Ubuntu 10.10 the unfocused selection background is different from the focused one. Interestingly they use GTK_STATE_ACTIVE for unfocused widgets. This was verified back to GTK 2.10 which is the required minimum for QGtkStyle so it should be safe for all other styles as well. Task-number: QTBUG-13792 Reviewed-by: thorbjorn --- src/gui/styles/qgtkstyle.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index c5429dd..7f342f9 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -225,9 +225,8 @@ QPalette QGtkStyle::standardPalette() const GtkStyle *style = d->gtkStyle(); GtkWidget *gtkButton = d->gtkWidget("GtkButton"); GtkWidget *gtkEntry = d->getTextColorWidget(); - - GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg; - QColor bg, base, text, fg, highlight, highlightText; + GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg, gdkaSbg, gdkaSfg; + QColor bg, base, text, fg, highlight, highlightText, inactiveHighlight, inactiveHighlightedTExt; gdkBg = style->bg[GTK_STATE_NORMAL]; gdkForeground = gtkButton->style->fg[GTK_STATE_NORMAL]; @@ -237,14 +236,23 @@ QPalette QGtkStyle::standardPalette() const gdkText = gtkEntry->style->text[GTK_STATE_NORMAL]; gdkSbg = gtkEntry->style->base[GTK_STATE_SELECTED]; gdkSfg = gtkEntry->style->text[GTK_STATE_SELECTED]; + + // The ACTIVE base color is really used for inactive windows + gdkaSbg = gtkEntry->style->base[GTK_STATE_ACTIVE]; + gdkaSfg = gtkEntry->style->text[GTK_STATE_ACTIVE]; + bg = QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8); text = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); fg = QColor(gdkForeground.red>>8, gdkForeground.green>>8, gdkForeground.blue>>8); base = QColor(gdkBase.red>>8, gdkBase.green>>8, gdkBase.blue>>8); highlight = QColor(gdkSbg.red>>8, gdkSbg.green>>8, gdkSbg.blue>>8); highlightText = QColor(gdkSfg.red>>8, gdkSfg.green>>8, gdkSfg.blue>>8); + inactiveHighlight = QColor(gdkaSbg.red>>8, gdkaSbg.green>>8, gdkaSbg.blue>>8); + inactiveHighlightedTExt = QColor(gdkaSfg.red>>8, gdkaSfg.green>>8, gdkaSfg.blue>>8); palette.setColor(QPalette::HighlightedText, highlightText); + + palette.setColor(QPalette::Light, bg.lighter(125)); palette.setColor(QPalette::Shadow, bg.darker(130)); palette.setColor(QPalette::Dark, bg.darker(120)); @@ -279,6 +287,10 @@ QPalette QGtkStyle::standardPalette() const highlightText.setHsv(highlightText.hue(), 0, highlightText.value(), highlightText.alpha()); palette.setColor(QPalette::Disabled, QPalette::Highlight, highlight); palette.setColor(QPalette::Disabled, QPalette::HighlightedText, highlightText); + + palette.setColor(QPalette::Inactive, QPalette::HighlightedText, inactiveHighlightedTExt); + palette.setColor(QPalette::Inactive, QPalette::Highlight, inactiveHighlight); + style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), "gtk-tooltips", "GtkWindow", d->gtk_window_get_type()); if (style) { -- cgit v0.12 From 1f14df23bf0e593c31efc846c13f11afb0fad6b8 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 28 Sep 2010 11:01:20 +0100 Subject: Progressive download in Phonon MMF backend: added download managers This patch adds a Download class which uses the RHttpDownloadMgr API to download a media clip over HTTP. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft --- src/3rdparty/phonon/mmf/download.cpp | 194 +++++++++++++++++++++++++++++++++++ src/3rdparty/phonon/mmf/download.h | 111 ++++++++++++++++++++ src/plugins/phonon/mmf/mmf.pro | 3 + 3 files changed, 308 insertions(+) create mode 100644 src/3rdparty/phonon/mmf/download.cpp create mode 100644 src/3rdparty/phonon/mmf/download.h diff --git a/src/3rdparty/phonon/mmf/download.cpp b/src/3rdparty/phonon/mmf/download.cpp new file mode 100644 index 0000000..7b80e4a --- /dev/null +++ b/src/3rdparty/phonon/mmf/download.cpp @@ -0,0 +1,194 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#include "download.h" +#include "utils.h" +#include +#include + +QT_BEGIN_NAMESPACE + +using namespace Phonon; +using namespace Phonon::MMF; + +static const TBool InheritDownloads = EFalse; + +DownloadPrivate::DownloadPrivate(Download *parent) + : QObject(parent) + , m_parent(parent) + , m_download(0) + , m_length(0) +{ + +} + +DownloadPrivate::~DownloadPrivate() +{ + m_downloadManager.Disconnect(); + m_downloadManager.Close(); +} + +bool DownloadPrivate::start() +{ + TRACE_CONTEXT(DownloadPrivate::start, EVideoApi); + Q_ASSERT(!m_download); + // Connect to download manager + RProcess process; + const TUid uid3 = process.SecureId(); + TRAPD(err, m_downloadManager.ConnectL(uid3, *this, InheritDownloads)); + TRACE("connect err %d", err); + if (KErrNone == err) { + // Start download + QHBufC url(m_parent->sourceUrl().toString()); + TPtr8 url8 = url->Des().Collapse(); + TRAP(err, m_download = &m_downloadManager.CreateDownloadL(url8)); + TRACE("start err %d", err); + if (KErrNone == err) + m_download->Start(); + } + return (KErrNone == err); +} + +void DownloadPrivate::resume() +{ + +} + +void DownloadPrivate::HandleDMgrEventL(RHttpDownload &aDownload, THttpDownloadEvent aEvent) +{ + TRACE_CONTEXT(DownloadPrivate::HandleDMgrEventL, EVideoApi); + Q_ASSERT(&aDownload == m_download); + switch (aEvent.iDownloadState) { + case EHttpDlPaused: + if (EHttpContentTypeReceived == aEvent.iProgressState) { + TRACE_0("paused, content type received"); + m_download->Start(); + } + break; + case EHttpDlInprogress: + switch (aEvent.iProgressState) { + case EHttpProgResponseHeaderReceived: + { + TFileName fileName; + m_download->GetStringAttribute(EDlAttrDestFilename, fileName); + TRACE("in progress, response header received, filename %S", &fileName); + const QString fileNameQt = QDir::fromNativeSeparators(qt_TDesC2QString(fileName)); + m_parent->downloadStarted(fileNameQt); + } + break; + case EHttpProgResponseBodyReceived: + { + TInt32 length = 0; + m_download->GetIntAttribute(EDlAttrDownloadedSize, length); + if (length != m_length) { + TRACE("in progress, length %d", length); + m_length = length; + emit lengthChanged(m_length); + } + } + break; + } + break; + case EHttpDlCompleted: + TRACE_0("complete"); + m_parent->complete(); + break; + case EHttpDlFailed: + TRACE_0("failed"); + m_parent->error(); + break; + } +} + +Download::Download(const QUrl &url, QObject *parent) + : QObject(parent) + , m_private(new DownloadPrivate(this)) + , m_sourceUrl(url) + , m_state(Idle) +{ + qRegisterMetaType(); + connect(m_private, SIGNAL(lengthChanged(qint64)), this, SIGNAL(lengthChanged(qint64))); +} + +Download::~Download() +{ + +} + +const QUrl &Download::sourceUrl() const +{ + return m_sourceUrl; +} + +const QString &Download::targetFileName() const +{ + return m_targetFileName; +} + +void Download::start() +{ + TRACE_CONTEXT(Download::start, EVideoApi); + TRACE_ENTRY_0(); + Q_ASSERT(Idle == m_state); + const bool ok = m_private->start(); + setState(ok ? Initializing : Error); + TRACE_EXIT_0(); +} + +void Download::resume() +{ + TRACE_CONTEXT(Download::resume, EVideoApi); + TRACE_ENTRY_0(); + m_private->resume(); + TRACE_EXIT_0(); +} + +void Download::setState(State state) +{ + TRACE_CONTEXT(Download::setState, EVideoApi); + TRACE("oldState %d newState %d", m_state, state); + const State oldState = m_state; + m_state = state; + if (oldState != m_state) + emit stateChanged(m_state); +} + +void Download::error() +{ + TRACE_CONTEXT(Download::error, EVideoApi); + TRACE_0(""); + setState(Error); +} + +void Download::downloadStarted(const QString &targetFileName) +{ + TRACE_CONTEXT(Download::downloadStarted, EVideoApi); + TRACE_0("downloadStarted"); + m_targetFileName = targetFileName; + setState(Downloading); +} + +void Download::complete() +{ + TRACE_CONTEXT(Download::complete, EVideoApi); + TRACE_0(""); + setState(Complete); +} + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/download.h b/src/3rdparty/phonon/mmf/download.h new file mode 100644 index 0000000..b57348b --- /dev/null +++ b/src/3rdparty/phonon/mmf/download.h @@ -0,0 +1,111 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see . + +*/ + +#ifndef PHONON_MMF_DOWNLOAD_H +#define PHONON_MMF_DOWNLOAD_H + +#include +#include +#include +#include + +QT_FORWARD_DECLARE_CLASS(QByteArray) +QT_FORWARD_DECLARE_CLASS(QFile) + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ +namespace MMF +{ + +class Download; + +class DownloadPrivate : public QObject + , public MHttpDownloadMgrObserver +{ + Q_OBJECT +public: + DownloadPrivate(Download *parent); + ~DownloadPrivate(); + bool start(); + void resume(); +signals: + void error(); + void targetFileNameChanged(); + void lengthChanged(qint64 length); + void complete(); +private: + // MHttpDownloadMgrObserver + void HandleDMgrEventL(RHttpDownload &aDownload, THttpDownloadEvent aEvent); +private: + Download *m_parent; + RHttpDownloadMgr m_downloadManager; + RHttpDownload *m_download; + qint64 m_length; +}; + +class Download : public QObject +{ + Q_OBJECT + friend class DownloadPrivate; +public: + Download(const QUrl &url, QObject *parent = 0); + ~Download(); + const QUrl &sourceUrl() const; + const QString &targetFileName() const; + void start(); + + // Only has effect when QT_PHONON_MMF_DOWNLOAD_DUMMY is defined + void resume(); + + enum State { + Idle, + Initializing, + Downloading, + Complete, + Error + }; + +signals: + void lengthChanged(qint64 length); + void stateChanged(Download::State state); + +private: + void setState(State state); + + // Called by DownloadPrivate + void error(); + void downloadStarted(const QString &targetFileName); + void complete(); + +private: + DownloadPrivate *m_private; + QUrl m_sourceUrl; + QString m_targetFileName; + State m_state; +}; + +} +} + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(Phonon::MMF::Download::State) + +#endif diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 7a6fdf8..902354f 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -36,6 +36,7 @@ symbian { $$PHONON_MMF_DIR/backend.h \ $$PHONON_MMF_DIR/bassboost.h \ $$PHONON_MMF_DIR/defs.h \ + $$PHONON_MMF_DIR/download.h \ $$PHONON_MMF_DIR/dummyplayer.h \ $$PHONON_MMF_DIR/effectfactory.h \ $$PHONON_MMF_DIR/effectparameter.h \ @@ -61,6 +62,7 @@ symbian { $$PHONON_MMF_DIR/abstractvideoplayer.cpp \ $$PHONON_MMF_DIR/backend.cpp \ $$PHONON_MMF_DIR/bassboost.cpp \ + $$PHONON_MMF_DIR/download.cpp \ $$PHONON_MMF_DIR/dummyplayer.cpp \ $$PHONON_MMF_DIR/effectfactory.cpp \ $$PHONON_MMF_DIR/effectparameter.cpp \ @@ -111,6 +113,7 @@ symbian { LIBS += -lapgrfx -lapmime # For recognizer LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream + LIBS += -ldownloadmgr # These are for effects. LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect -- cgit v0.12 From 865a9214fbb858cd5089aa3073ad2cff305017ea Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 28 Sep 2010 11:05:41 +0100 Subject: Progressive download in Phonon MMF backend: integrated with player This commit integrates the Download class with the media playback classes in the backend, to implement Progressive Download. Note that this PDL implementation has one drawback: when video playback is paused due to shortage of data (i.e. due to the download being temporarily stalled), the display goes black. This is because, when the end of the currently-downloaded data is reached, the playback session is closed. When more data becomes available, the clip is re-opened, a seek is done to reach the previous playback position, and playback is re-started. Closing the playback session closes the video stack's connection to the display, thereby causing the video widget to go black while more data is buffered. This is a consequence of the level in the native video stack at which the Phonon integration is done: managing a network stall without requiring the playback session to be closed would require integration below the MMF client API, specifically at the MMF controller level. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 148 +++++++++++++++++++++--- src/3rdparty/phonon/mmf/abstractmediaplayer.h | 17 +++ src/3rdparty/phonon/mmf/abstractvideoplayer.cpp | 24 +++- src/3rdparty/phonon/mmf/abstractvideoplayer.h | 5 +- src/3rdparty/phonon/mmf/audioplayer.cpp | 18 ++- src/3rdparty/phonon/mmf/audioplayer.h | 5 +- src/3rdparty/phonon/mmf/mediaobject.cpp | 36 +++--- src/3rdparty/phonon/mmf/mediaobject.h | 1 + 8 files changed, 211 insertions(+), 43 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 3702560..a728423 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -51,10 +51,13 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer , m_parent(parent) , m_pending(NothingPending) , m_positionTimer(new QTimer(this)) + , m_position(0) , m_bufferStatusTimer(new QTimer(this)) , m_mmfMaxVolume(NullMaxVolume) , m_prefinishMarkSent(false) , m_aboutToFinishSent(false) + , m_download(0) + , m_downloadStalled(false) { connect(m_positionTimer.data(), SIGNAL(timeout()), this, SLOT(positionTick())); connect(m_bufferStatusTimer.data(), SIGNAL(timeout()), this, SLOT(bufferStatusTick())); @@ -183,6 +186,7 @@ void MMF::AbstractMediaPlayer::seek(qint64 ms) } doSeek(ms); + m_position = ms; resetMarksIfRewound(); if(wasPlaying && state() != ErrorState) { @@ -207,6 +211,11 @@ bool MMF::AbstractMediaPlayer::isSeekable() const return true; } +qint64 MMF::AbstractMediaPlayer::currentTime() const +{ + return m_position; +} + void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval) { TRACE_CONTEXT(AbstractMediaPlayer::doSetTickInterval, EAudioApi); @@ -247,6 +256,14 @@ void MMF::AbstractMediaPlayer::open() symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); + } else if (url.scheme() == QLatin1String("http")) { + Q_ASSERT(!m_download); + m_download = new Download(url, this); + connect(m_download, SIGNAL(lengthChanged(qint64)), + this, SLOT(downloadLengthChanged(qint64))); + connect(m_download, SIGNAL(stateChanged(Download::State)), + this, SLOT(downloadStateChanged(Download::State))); + m_download->start(); } else { symbianErr = openUrl(url.toString()); if (KErrNone != symbianErr) @@ -288,6 +305,14 @@ void MMF::AbstractMediaPlayer::open() TRACE_EXIT_0(); } +void MMF::AbstractMediaPlayer::close() +{ + doClose(); + delete m_download; + m_download = 0; + m_position = 0; +} + void MMF::AbstractMediaPlayer::volumeChanged(qreal volume) { TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal); @@ -374,7 +399,8 @@ void MMF::AbstractMediaPlayer::bufferingComplete() { stopBufferStatusTimer(); emit MMF::AbstractPlayer::bufferStatus(100); - changeState(m_stateBeforeBuffering); + if (!progressiveDownloadStalled()) + changeState(m_stateBeforeBuffering); } void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume) @@ -385,13 +411,28 @@ void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume) void MMF::AbstractMediaPlayer::loadingComplete(int error) { - Q_ASSERT(Phonon::LoadingState == state()); - - if (KErrNone == error) { - updateMetaData(); - changeState(StoppedState); + TRACE_CONTEXT(AbstractMediaPlayer::loadingComplete, EAudioApi); + TRACE_ENTRY("state %d error %d", state(), error); + if (progressiveDownloadStalled()) { + Q_ASSERT(Phonon::BufferingState == state()); + if (KErrNone == error) { + bufferingComplete(); + doSeek(m_position); + startPlayback(); + m_downloadStalled = false; + } } else { - setError(tr("Loading clip failed"), error); + Q_ASSERT(Phonon::LoadingState == state()); + if (KErrNone == error) { + updateMetaData(); + changeState(StoppedState); + } else { + if (isProgressiveDownload() && KErrCorrupt == error) { + setProgressiveDownloadStalled(); + } else { + setError(tr("Loading clip failed"), error); + } + } } } @@ -415,8 +456,12 @@ void MMF::AbstractMediaPlayer::playbackComplete(int error) QMetaObject::invokeMethod(m_parent, "switchToNextSource", Qt::QueuedConnection); } else { - setError(tr("Playback complete"), error); - emit finished(); + if (isProgressiveDownload() && KErrCorrupt == error) { + setProgressiveDownloadStalled(); + } else { + setError(tr("Playback complete"), error); + emit finished(); + } } } @@ -425,15 +470,28 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds return in.Int64() / 1000; } +bool MMF::AbstractMediaPlayer::isProgressiveDownload() const +{ + return (0 != m_download); +} + +bool MMF::AbstractMediaPlayer::progressiveDownloadStalled() const +{ + return m_downloadStalled; +} + //----------------------------------------------------------------------------- // Slots //----------------------------------------------------------------------------- void MMF::AbstractMediaPlayer::positionTick() { - const qint64 current = currentTime(); - emitMarksIfReached(current); - emit MMF::AbstractPlayer::tick(current); + const qint64 pos = getCurrentTime(); + if (pos > m_position) { + m_position = pos; + emitMarksIfReached(m_position); + emit MMF::AbstractPlayer::tick(m_position); + } } void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current) @@ -458,7 +516,7 @@ void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current) void MMF::AbstractMediaPlayer::resetMarksIfRewound() { - const qint64 current = currentTime(); + const qint64 current = getCurrentTime(); const qint64 total = totalTime(); const qint64 remaining = total - current; @@ -487,9 +545,71 @@ void MMF::AbstractMediaPlayer::startPlayback() changeState(PlayingState); } +void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled() +{ + TRACE_CONTEXT(AbstractMediaPlayer::setProgressiveDownloadStalled, EAudioApi); + TRACE_ENTRY("state %d", state()); + Q_ASSERT(isProgressiveDownload()); + m_downloadStalled = true; + doClose(); + bufferingStarted(); + // Video player loses window handle when closed - need to reapply it here + videoOutputChanged(); +#ifdef QT_PHONON_MMF_DOWNLOAD_DUMMY + m_download->resume(); +#endif +} + void MMF::AbstractMediaPlayer::bufferStatusTick() { - emit MMF::AbstractPlayer::bufferStatus(bufferStatus()); + // During progressive download, there is no way to detect the buffering status. + // Phonon does not support a "buffering; amount unknown" signal, therefore we + // return a buffering status of zero. + const int status = progressiveDownloadStalled() ? 0 : bufferStatus(); + emit MMF::AbstractPlayer::bufferStatus(status); +} + +void MMF::AbstractMediaPlayer::downloadLengthChanged(qint64 length) +{ + TRACE_CONTEXT(AbstractMediaPlayer::downloadLengthChanged, EAudioApi); + TRACE_ENTRY("length %Ld", length); + Q_UNUSED(length) + if (m_downloadStalled) { + bufferingComplete(); + int err = m_parent->openFileHandle(m_download->targetFileName()); + if (KErrNone == err) + err = openFile(*m_parent->file()); + if (KErrNone != err) + setError(tr("Error opening file")); + } +} + +void MMF::AbstractMediaPlayer::downloadStateChanged(Download::State state) +{ + TRACE_CONTEXT(AbstractMediaPlayer::downloadStateChanged, EAudioApi); + TRACE_ENTRY("state %d", state); + switch (state) { + case Download::Idle: + case Download::Initializing: + break; + case Download::Downloading: + { + int err = m_parent->openFileHandle(m_download->targetFileName()); + if (KErrNone == err) + err = openFile(*m_parent->file()); + else if (KErrCorrupt == err) + // Insufficient data downloaded - enter Buffering state + setProgressiveDownloadStalled(); + if (KErrNone != err) + setError(tr("Error opening file")); + } + break; + case Download::Complete: + break; + case Download::Error: + setError(tr("Download error")); + break; + } } Phonon::State MMF::AbstractMediaPlayer::phononState(PrivateState state) const diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index e795ecb..99fc101 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -23,6 +23,7 @@ along with this library. If not, see . #include #include #include "abstractplayer.h" +#include "download.h" class RFile; @@ -48,6 +49,7 @@ protected: public: virtual void open(); + virtual void close(); // MediaObjectInterface virtual void play(); @@ -55,6 +57,7 @@ public: virtual void stop(); virtual void seek(qint64 milliseconds); virtual bool isSeekable() const; + virtual qint64 currentTime() const; virtual void volumeChanged(qreal volume); protected: @@ -68,12 +71,15 @@ protected: virtual void doStop() = 0; virtual void doSeek(qint64 pos) = 0; virtual int setDeviceVolume(int mmfVolume) = 0; + virtual int openFile(const QString &fileName) = 0; virtual int openFile(RFile& file) = 0; virtual int openUrl(const QString& url) = 0; virtual int openDescriptor(const TDesC8 &des) = 0; virtual int bufferStatus() const = 0; + virtual void doClose() = 0; void updateMetaData(); + virtual qint64 getCurrentTime() const = 0; virtual int numberOfMetaDataEntries() const = 0; virtual QPair metaDataEntry(int index) const = 0; @@ -86,6 +92,9 @@ protected: static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &); + bool isProgressiveDownload() const; + bool progressiveDownloadStalled() const; + private: void startPositionTimer(); void stopPositionTimer(); @@ -96,6 +105,7 @@ private: void emitMarksIfReached(qint64 position); void resetMarksIfRewound(); void startPlayback(); + void setProgressiveDownloadStalled(); enum Pending { NothingPending, @@ -108,6 +118,8 @@ private: private Q_SLOTS: void positionTick(); void bufferStatusTick(); + void downloadLengthChanged(qint64); + void downloadStateChanged(Download::State); private: MediaObject *const m_parent; @@ -115,6 +127,7 @@ private: Pending m_pending; QScopedPointer m_positionTimer; + qint64 m_position; QScopedPointer m_bufferStatusTimer; PrivateState m_stateBeforeBuffering; @@ -127,6 +140,10 @@ private: // Used for playback of resource files TPtrC8 m_buffer; + // Used for progressive download + Download *m_download; + bool m_downloadStalled; + QMultiMap m_metaData; }; diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp index fb20bea..1ab5bae 100644 --- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp @@ -16,6 +16,7 @@ along with this library. If not, see . */ +#include #include #include #include @@ -132,6 +133,13 @@ int MMF::AbstractVideoPlayer::setDeviceVolume(int mmfVolume) return err; } +int MMF::AbstractVideoPlayer::openFile(const QString &fileName) +{ + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); + TRAPD(err, m_player->OpenFileL(*nativeFileName)); + return err; +} + int MMF::AbstractVideoPlayer::openFile(RFile &file) { TRAPD(err, m_player->OpenFileL(file)); @@ -157,7 +165,7 @@ int MMF::AbstractVideoPlayer::bufferStatus() const return result; } -void MMF::AbstractVideoPlayer::close() +void MMF::AbstractVideoPlayer::doClose() { m_player->Close(); } @@ -167,9 +175,9 @@ bool MMF::AbstractVideoPlayer::hasVideo() const return true; } -qint64 MMF::AbstractVideoPlayer::currentTime() const +qint64 MMF::AbstractVideoPlayer::getCurrentTime() const { - TRACE_CONTEXT(AbstractVideoPlayer::currentTime, EVideoApi); + TRACE_CONTEXT(AbstractVideoPlayer::getCurrentTime, EVideoApi); TTimeIntervalMicroSeconds us; TRAPD(err, us = m_player->PositionL()) @@ -246,7 +254,9 @@ void MMF::AbstractVideoPlayer::MvpuoOpenComplete(TInt aError) TRACE_CONTEXT(AbstractVideoPlayer::MvpuoOpenComplete, EVideoApi); TRACE_ENTRY("state %d error %d", state(), aError); - __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic)); + __ASSERT_ALWAYS(LoadingState == state() || + progressiveDownloadStalled() && BufferingState == state(), + Utils::panic(InvalidStatePanic)); if (KErrNone == aError) m_player->Prepare(); @@ -261,7 +271,9 @@ void MMF::AbstractVideoPlayer::MvpuoPrepareComplete(TInt aError) TRACE_CONTEXT(AbstractVideoPlayer::MvpuoPrepareComplete, EVideoApi); TRACE_ENTRY("state %d error %d", state(), aError); - __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic)); + __ASSERT_ALWAYS(LoadingState == state() || + progressiveDownloadStalled() && BufferingState == state(), + Utils::panic(InvalidStatePanic)); TRAPD(err, getVideoClipParametersL(aError)); @@ -470,7 +482,7 @@ void MMF::AbstractVideoPlayer::updateScaleFactors(const QSize &windowSize, bool void MMF::AbstractVideoPlayer::parametersChanged(VideoParameters parameters) { - if (state() == LoadingState) + if (state() == LoadingState || progressiveDownloadStalled() && BufferingState == state()) m_pendingChanges |= parameters; else handleParametersChanged(parameters); diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.h b/src/3rdparty/phonon/mmf/abstractvideoplayer.h index 3ff3c75..3bc5c7c 100644 --- a/src/3rdparty/phonon/mmf/abstractvideoplayer.h +++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.h @@ -64,21 +64,22 @@ public: virtual void doStop(); virtual void doSeek(qint64 milliseconds); virtual int setDeviceVolume(int mmfVolume); + virtual int openFile(const QString &fileName); virtual int openFile(RFile &file); virtual int openUrl(const QString &url); virtual int openDescriptor(const TDesC8 &des); virtual int bufferStatus() const; - virtual void close(); + virtual void doClose(); // MediaObjectInterface virtual bool hasVideo() const; - virtual qint64 currentTime() const; virtual qint64 totalTime() const; // AbstractPlayer virtual void videoOutputChanged(); // AbstractMediaPlayer + virtual qint64 getCurrentTime() const; virtual int numberOfMetaDataEntries() const; virtual QPair metaDataEntry(int index) const; diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index 7c8b9bd..dc5c800 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -16,6 +16,7 @@ along with this library. If not, see . */ +#include #include #include "audioplayer.h" @@ -109,6 +110,13 @@ int MMF::AudioPlayer::setDeviceVolume(int mmfVolume) #endif } +int MMF::AudioPlayer::openFile(const QString &fileName) +{ + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); + TRAPD(err, m_player->OpenFileL(*nativeFileName)); + return err; +} + int MMF::AudioPlayer::openFile(RFile& file) { TRAPD(err, m_player->OpenFileL(file)); @@ -150,7 +158,7 @@ int MMF::AudioPlayer::bufferStatus() const return result; } -void MMF::AudioPlayer::close() +void MMF::AudioPlayer::doClose() { m_player->Close(); } @@ -160,9 +168,9 @@ bool MMF::AudioPlayer::hasVideo() const return false; } -qint64 MMF::AudioPlayer::currentTime() const +qint64 MMF::AudioPlayer::getCurrentTime() const { - TRACE_CONTEXT(AudioPlayer::currentTime, EAudioApi); + TRACE_CONTEXT(AudioPlayer::getCurrentTime, EAudioApi); TTimeIntervalMicroSeconds us; const TInt err = m_player->GetPosition(us); @@ -203,7 +211,9 @@ void MMF::AudioPlayer::MapcInitComplete(TInt aError, TRACE_CONTEXT(AudioPlayer::MapcInitComplete, EAudioInternal); TRACE_ENTRY("state %d error %d", state(), aError); - __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic)); + __ASSERT_ALWAYS(LoadingState == state() || + progressiveDownloadStalled() && BufferingState == state(), + Utils::panic(InvalidStatePanic)); if (KErrNone == aError) { maxVolumeChanged(m_player->MaxVolume()); diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h index e43cadd..cf4f6d5 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.h +++ b/src/3rdparty/phonon/mmf/audioplayer.h @@ -65,18 +65,19 @@ typedef CMdaAudioPlayerUtility NativePlayer; virtual void doStop(); virtual void doSeek(qint64 milliseconds); virtual int setDeviceVolume(int mmfVolume); + virtual int openFile(const QString &fileName); virtual int openFile(RFile& file); virtual int openUrl(const QString& url); virtual int openDescriptor(const TDesC8 &des); virtual int bufferStatus() const; - virtual void close(); + virtual void doClose(); // MediaObjectInterface virtual bool hasVideo() const; - virtual qint64 currentTime() const; virtual qint64 totalTime() const; // AbstractMediaPlayer + virtual qint64 getCurrentTime() const; virtual int numberOfMetaDataEntries() const; virtual QPair metaDataEntry(int index) const; diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 98326b8..2c7a7ef 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -61,6 +61,9 @@ MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(paren TRACE_CONTEXT(MediaObject::MediaObject, EAudioApi); TRACE_ENTRY_0(); + const int err = m_fileServer.Connect(); + QT_TRAP_THROWING(User::LeaveIfError(err)); + Q_UNUSED(parent); TRACE_EXIT_0(); @@ -99,12 +102,6 @@ bool MMF::MediaObject::openRecognizer() return false; } - err = m_fileServer.Connect(); - if (KErrNone != err) { - TRACE("RFs::Connect error %d", err); - return false; - } - // This must be called in order to be able to share file handles with // the recognizer server (see fileMediaType function). err = m_fileServer.ShareProtected(); @@ -127,13 +124,8 @@ MMF::MediaType MMF::MediaObject::fileMediaType MediaType result = MediaTypeUnknown; if (openRecognizer()) { - - const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName)); - - Q_ASSERT(!m_file); - m_file = new RFile; - TInt err = m_file->Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly); - + TInt err = openFileHandle(fileName); + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); if (KErrNone == err) { TDataRecognitionResult recognizerResult; err = m_recognizer.RecognizeData(*m_file, recognizerResult); @@ -141,16 +133,30 @@ MMF::MediaType MMF::MediaObject::fileMediaType const TPtrC mimeType = recognizerResult.iDataType.Des(); result = Utils::mimeTypeToMediaType(mimeType); } else { - TRACE("RApaLsSession::RecognizeData filename %S error %d", fileNameSymbian.data(), err); + TRACE("RApaLsSession::RecognizeData filename %S error %d", nativeFileName.data(), err); } } else { - TRACE("RFile::Open filename %S error %d", fileNameSymbian.data(), err); + TRACE("RFile::Open filename %S error %d", nativeFileName.data(), err); } } return result; } +int MMF::MediaObject::openFileHandle(const QString &fileName) +{ + TRACE_CONTEXT(MediaObject::openFileHandle, EAudioInternal); + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); + TRACE_ENTRY("filename %S", nativeFileName.data()); + if (m_file) + m_file->Close(); + delete m_file; + m_file = 0; + m_file = new RFile; + TInt err = m_file->Open(m_fileServer, *nativeFileName, EFileRead | EFileShareReadersOrWriters); + return err; +} + MMF::MediaType MMF::MediaObject::bufferMediaType(const uchar *data, qint64 size) { TRACE_CONTEXT(MediaObject::bufferMediaType, EAudioInternal); diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h index 5399e27..5d785fb 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.h +++ b/src/3rdparty/phonon/mmf/mediaobject.h @@ -89,6 +89,7 @@ public: void setVideoOutput(AbstractVideoOutput* videoOutput); + int openFileHandle(const QString &fileName); RFile* file() const; QResource* resource() const; -- cgit v0.12 From bd53ef2094a020789e9543156c524cd90a2d5302 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 27 Sep 2010 18:07:35 +0100 Subject: qmediaplayer: show buffer status of 0% During progressive download, it is not possible for the Symbian MMF Phonon backend to determine the buffering status, so it returns a value of 0%. This change causes qmediaplayer to display this value in the UI, thereby giving a visible notification of buffering during progressive download. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft --- demos/qmediaplayer/mediaplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp index 3cb0616..97a8e35 100644 --- a/demos/qmediaplayer/mediaplayer.cpp +++ b/demos/qmediaplayer/mediaplayer.cpp @@ -716,7 +716,7 @@ void MediaPlayer::openFile() void MediaPlayer::bufferStatus(int percent) { - if (percent == 0 || percent == 100) + if (percent == 100) progressLabel->setText(QString()); else { QString str = QString::fromLatin1("(%1%)").arg(percent); -- cgit v0.12 From 19085117bfece0709c996ed445a476add4f6815b Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 1 Oct 2010 12:40:44 +0200 Subject: Fix focus appearance of tabwidget tabs with QGtkStyle There was an issue with ubuntu Ambience theme since it requires a custom tab style. This was not currently supported by QGtkStyle. Task-number: QTBUG-14161 Reviewed-by: thorbjorn --- src/gui/styles/qgtkstyle.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 7f342f9..9cc64b3 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -803,10 +803,13 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, // ### this mess should move to subcontrolrect QRect frameRect = option->rect.adjusted(1, 1, -1, -2); - if (qobject_cast(widget)) - frameRect.adjust(-1, 1, 1, 1); - - gtkPainter.paintFocus(NULL, "tab", frameRect, GTK_STATE_ACTIVE, style); + if (qobject_cast(widget)) { + GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook"); + style = gtkPainter.getStyle(gtkNotebook); + gtkPainter.paintFocus(gtkNotebook, "tab", frameRect.adjusted(-1, 1, 1, 1), GTK_STATE_ACTIVE, style); + } else { + gtkPainter.paintFocus(NULL, "tab", frameRect, GTK_STATE_ACTIVE, style); + } } break; -- cgit v0.12 From 8a895dbcc9aacab3b0059119650a74bbaff1a27b Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Thu, 30 Sep 2010 10:04:50 +0200 Subject: Setting the _NET_WM_STATE Atom only when its not already set Task: QT-3918 Reviewed By: Bradley T. Hughes --- src/gui/kernel/qwidget_x11.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 8d80e10..9085e98 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -1933,20 +1933,27 @@ void QWidgetPrivate::show_sys() if (flags & Qt::WindowStaysOnTopHint) { if (flags & Qt::WindowStaysOnBottomHint) qWarning() << "QWidget: Incompatible window flags: the window can't be on top and on bottom at the same time"; - netWmState.append(ATOM(_NET_WM_STATE_ABOVE)); - netWmState.append(ATOM(_NET_WM_STATE_STAYS_ON_TOP)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_ABOVE))) + netWmState.append(ATOM(_NET_WM_STATE_ABOVE)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_STAYS_ON_TOP))) + netWmState.append(ATOM(_NET_WM_STATE_STAYS_ON_TOP)); } else if (flags & Qt::WindowStaysOnBottomHint) { - netWmState.append(ATOM(_NET_WM_STATE_BELOW)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_BELOW))) + netWmState.append(ATOM(_NET_WM_STATE_BELOW)); } if (q->isFullScreen()) { - netWmState.append(ATOM(_NET_WM_STATE_FULLSCREEN)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_FULLSCREEN))) + netWmState.append(ATOM(_NET_WM_STATE_FULLSCREEN)); } if (q->isMaximized()) { - netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ)); - netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_VERT)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ))) + netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_MAXIMIZED_VERT))) + netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_VERT)); } if (data.window_modality != Qt::NonModal) { - netWmState.append(ATOM(_NET_WM_STATE_MODAL)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_MODAL))) + netWmState.append(ATOM(_NET_WM_STATE_MODAL)); } if (!netWmState.isEmpty()) { -- cgit v0.12 From dc4d4a87c0c17e41c0e16bc481db82de0f620596 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 1 Oct 2010 14:26:49 +0200 Subject: Doc: Implementing features to the search feature. Adding search to narrow/slim fit mode --- doc/src/template/scripts/functions.js | 2 +- doc/src/template/style/narrow.css | 1 + doc/src/template/style/style.css | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 0bb88a8..b89e05f 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -89,7 +89,7 @@ function processNokiaData(response){ /* fetch the responce from the server using page as the root element */ var propertyTags = response.getElementsByTagName('page'); /* reset counters */ - var lookupCount = 0; + var apiCount = 0; var articleCount = 0; var exampleCount = 0; var full_li_element; diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index 8e42a0d..c1e3f61 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -61,6 +61,7 @@ { background-image: none; text-indent: 0; + width: 260px; } .narrow .header #nav-topright diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 5833266..c07385c 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -204,6 +204,10 @@ { font-size: 13px; } + .red + { + color:red; + } /* end font style elements */ /* global settings*/ @@ -907,7 +911,6 @@ .wrap .content table p { line-height: 20px; - /* padding: 0px;*/ } .wrap .content ul { -- cgit v0.12 From c168be1aa3dc4f7ccc70d530244fc97af0b4d1e1 Mon Sep 17 00:00:00 2001 From: mread Date: Fri, 1 Oct 2010 13:13:42 +0100 Subject: fixed hybrid heap Symbian udeb build issues Fixed name collision with TAllocFail Added definition for EDebugHdrSize and fixed scope issue Added definition for SRAllocatorBurstFail Added a definition for global enum ETHeapBadDebugFailParameter Tested compilation on: Symbian^3 RnD - armv5_urel, armv5_udeb, winscw_urel, winscw_udeb S60 3.1 SDK - armv5_urel, armv5_udeb S60 5.0 SDK - armv5_urel, armv5_udeb Symbian^3 PDK - armv5_urel, armv5_udeb Symbian^4 RnD - armv5_urel, armv5_udeb Basic functional testing on N8 armv5_urel Task-number: QTBUG-14168 Reviewed-by: Shane Kearns --- src/corelib/arch/symbian/debugfunction.cpp | 2 +- src/corelib/arch/symbian/heap_hybrid_p.h | 6 +++++- src/corelib/arch/symbian/qt_hybridheap_symbian_p.h | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/corelib/arch/symbian/debugfunction.cpp b/src/corelib/arch/symbian/debugfunction.cpp index f3b5d2d..91f6917 100644 --- a/src/corelib/arch/symbian/debugfunction.cpp +++ b/src/corelib/arch/symbian/debugfunction.cpp @@ -549,7 +549,7 @@ void ResetAllocCellLevels(TAny* aPtr, RHybridHeap::TCellType aType, TAny* aCell, if (aType == RHybridHeap::EGoodAllocatedCell) { - RHybridHeap::SDebugCell* DbgCell = (RHybridHeap::SDebugCell*)((TUint8*)aCell-RHeap::EDebugHdrSize); + RHybridHeap::SDebugCell* DbgCell = (RHybridHeap::SDebugCell*)((TUint8*)aCell-RHybridHeap::EDebugHdrSize); DbgCell->nestingLevel = 0; } } diff --git a/src/corelib/arch/symbian/heap_hybrid_p.h b/src/corelib/arch/symbian/heap_hybrid_p.h index 736af72..95fb3d4 100644 --- a/src/corelib/arch/symbian/heap_hybrid_p.h +++ b/src/corelib/arch/symbian/heap_hybrid_p.h @@ -103,11 +103,15 @@ public: EGetSize=48, EGetMaxLength, EGetBase, EAlignInteger, EAlignAddr }; enum TDebugOp { EWalk = 128, EHybridHeap }; - enum TAllocFail + enum THybridAllocFail { ERandom, ETrueRandom, EDeterministic, EHybridNone, EFailNext, EReset, EBurstRandom, EBurstTrueRandom, EBurstDeterministic, EBurstFailNext, ECheckFailure, }; + enum { EDebugHdrSize = sizeof(SDebugCell) }; +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS + struct SRAllocatorBurstFail {TInt iBurst; TInt iRate; TInt iUnused[2];}; +#endif struct HeapInfo { diff --git a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h index 5827aca..92cfe0e 100644 --- a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h +++ b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h @@ -100,6 +100,9 @@ inline int noBTrace() {return 0;} #define BTraceContext12(a,b,c,d,e) noBTrace() #endif +// declare ETHeapBadDebugFailParameter, where missing +#define ETHeapBadDebugFailParameter ((TCdtPanic)213) + #ifndef QT_SYMBIAN_HAVE_U32STD_H struct SThreadCreateInfo { -- cgit v0.12 From 628c9625c4bf6d0e189f9e8da5268eb7629e7597 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 1 Oct 2010 14:56:00 +0200 Subject: Doc: Fixing link titles and error color in search results --- doc/src/template/scripts/functions.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index b89e05f..47539d2 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -124,7 +124,7 @@ function processNokiaData(response){ /* adding the URL attribute*/ full_li_element += propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; /* adding the link title and closing the link and list elements */ - full_li_element += '">' + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + ''; + full_li_element += '">' + propertyTags[i].getElementsByTagName('pageWords')[0].firstChild.nodeValue + ''; /* appending the list element to the #resultlist div*/ $('#resultlist').append(full_li_element); } @@ -139,7 +139,12 @@ function processNokiaData(response){ $('#apicount').html(apiCount); $('#articlecount').html(articleCount); $('#examplecount').html(exampleCount); - } + + } + else { + $('#pageType').addClass('red'); + } + // Filtering results in display @@ -181,6 +186,7 @@ function CheckEmptyAndLoadList() /* Start Extracting information for feedback and adding this to the feedback form */ var pageUrl = window.location.href; var pageVal = $('title').html(); + $('#pageType').removeClass('red'); $('#feedUrl').remove(); $('#pageVal').remove(); $('.menuAlert').remove(); -- cgit v0.12 From d1b2480f33641055f2d729212addf059577a4e01 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Fri, 1 Oct 2010 15:33:37 +0100 Subject: Fixed crash on startup in Symbian debug build This fixes a typo in a debug-only function in the hybrid heap allocator. The typo causes an assertion to fail during startup of applications, when using a debug build of Qt. Reviewed-by: mread --- src/corelib/arch/symbian/debugfunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/arch/symbian/debugfunction.cpp b/src/corelib/arch/symbian/debugfunction.cpp index 91f6917..31937e8 100644 --- a/src/corelib/arch/symbian/debugfunction.cpp +++ b/src/corelib/arch/symbian/debugfunction.cpp @@ -1105,7 +1105,7 @@ void RHybridHeap::DoCheckSlab(slab* aSlab, TAllocatorType aSlabType, TAny* aBfr) unsigned used = SlabHeaderUsedm4(h)+4; unsigned size = SlabHeaderSize(h); __HEAP_CORRUPTED_TEST( (used < SLABSIZE),ETHeapBadCellAddress, aBfr, aSlab); - __HEAP_CORRUPTED_TEST( ((size > 3 ) && (size < MAXSLABSIZE)), ETHeapBadCellAddress,aBfr,aSlab); + __HEAP_CORRUPTED_TEST( ((size > 3 ) && (size <= MAXSLABSIZE)), ETHeapBadCellAddress,aBfr,aSlab); unsigned count = 0; switch ( aSlabType ) -- cgit v0.12 From b3a46493a1a74bd7918bd68638c28cf6e84eb57f Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 15 Jul 2010 16:08:43 +0200 Subject: QWorkspace: fix hardcoded min size overwriting the real min size The setMinimumSize call was having precedence over the minimumSizeHint, so when having a sizegrip enabled it was possible to resize a MDI window to a much smaller size than its min size (actually it would flicker between the two sizes, on each resize). Fixed by moving that min size (for the titlebar contents) to the calculations in minimumSizeHint(). Reviewed-by: mariusso --- src/gui/widgets/qworkspace.cpp | 15 +++++++++------ tests/auto/qworkspace/tst_qworkspace.cpp | 10 ++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/gui/widgets/qworkspace.cpp b/src/gui/widgets/qworkspace.cpp index 7180c4d..3a9b30c 100644 --- a/src/gui/widgets/qworkspace.cpp +++ b/src/gui/widgets/qworkspace.cpp @@ -2551,7 +2551,6 @@ QWorkspaceChild::QWorkspaceChild(QWidget* window, QWorkspace *parent, Qt::Window this, SLOT(titleBarDoubleClicked())); } - setMinimumSize(128, 0); int fw = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, this); setContentsMargins(fw, fw, fw, fw); @@ -2702,11 +2701,15 @@ QSize QWorkspaceChild::sizeHint() const QSize QWorkspaceChild::minimumSizeHint() const { - if (!childWidget) - return QWidget::minimumSizeHint() + baseSize(); - QSize s = childWidget->minimumSize(); - if (s.isEmpty()) - s = childWidget->minimumSizeHint(); + QSize s; + if (!childWidget) { + s = QWidget::minimumSizeHint(); + } else { + s = childWidget->minimumSize(); + if (s.isEmpty()) + s = childWidget->minimumSizeHint(); + } + s = s.expandedTo(QSize(128, 0)); return s + baseSize(); } diff --git a/tests/auto/qworkspace/tst_qworkspace.cpp b/tests/auto/qworkspace/tst_qworkspace.cpp index 4cf76b5..9039eb3 100644 --- a/tests/auto/qworkspace/tst_qworkspace.cpp +++ b/tests/auto/qworkspace/tst_qworkspace.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #if defined(QT3_SUPPORT) #include @@ -591,16 +592,25 @@ void tst_QWorkspace::childSize() MyChild *child = new MyChild(&ws); child->show(); + ws.addWindow(child); QCOMPARE(child->size(), child->sizeHint()); delete child; child = new MyChild(&ws); child->setFixedSize(200, 200); child->show(); + ws.addWindow(child); QCOMPARE(child->size(), child->minimumSize()); + QCOMPARE(child->parentWidget()->metaObject()->className(), "QWorkspaceChild"); + QVERIFY(child->parentWidget()->width() >= 200); + // check that the minimum size is respected, using closestAcceptableSize + // like QSizeGrip does. + const QSize newSize = QLayout::closestAcceptableSize(child->parentWidget(), QSize(100, 100)); + QVERIFY(newSize.width() >= 200); delete child; child = new MyChild(&ws); + ws.addWindow(child); child->resize(150, 150); child->show(); QCOMPARE(child->size(), QSize(150,150)); -- cgit v0.12 From 51d007e0fa699339f072956bbd8bfe33db9b7f70 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Sun, 3 Oct 2010 19:43:29 +0100 Subject: Added qmake check for presence of RHttpDownloadMgr header downloadmgrclient.h is not found on S^4 baselines, causing a build failure. This commit is a temporary workaround, which disables progressive download support if the header is not found. The correct solution is to determine whether the RHttpDownloadMgr definition has moved, and if so, to modify the .pro file to include the new path. Task-number: QTBUG-10769 Reviewed-by: TrustMe --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 26 ++++++++++-- src/3rdparty/phonon/mmf/abstractmediaplayer.h | 9 ++++- src/3rdparty/phonon/mmf/download.h | 2 - src/plugins/phonon/mmf/mmf.pro | 53 +++++++++++++++---------- 4 files changed, 61 insertions(+), 29 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index a728423..dfc5840 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -56,8 +56,10 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer , m_mmfMaxVolume(NullMaxVolume) , m_prefinishMarkSent(false) , m_aboutToFinishSent(false) +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD , m_download(0) , m_downloadStalled(false) +#endif { connect(m_positionTimer.data(), SIGNAL(timeout()), this, SLOT(positionTick())); connect(m_bufferStatusTimer.data(), SIGNAL(timeout()), this, SLOT(bufferStatusTick())); @@ -256,7 +258,9 @@ void MMF::AbstractMediaPlayer::open() symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); - } else if (url.scheme() == QLatin1String("http")) { + } +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD + else if (url.scheme() == QLatin1String("http")) { Q_ASSERT(!m_download); m_download = new Download(url, this); connect(m_download, SIGNAL(lengthChanged(qint64)), @@ -264,7 +268,9 @@ void MMF::AbstractMediaPlayer::open() connect(m_download, SIGNAL(stateChanged(Download::State)), this, SLOT(downloadStateChanged(Download::State))); m_download->start(); - } else { + } +#endif + else { symbianErr = openUrl(url.toString()); if (KErrNone != symbianErr) errorMessage = tr("Error opening URL"); @@ -308,8 +314,10 @@ void MMF::AbstractMediaPlayer::open() void MMF::AbstractMediaPlayer::close() { doClose(); +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD delete m_download; m_download = 0; +#endif m_position = 0; } @@ -419,7 +427,9 @@ void MMF::AbstractMediaPlayer::loadingComplete(int error) bufferingComplete(); doSeek(m_position); startPlayback(); +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD m_downloadStalled = false; +#endif } } else { Q_ASSERT(Phonon::LoadingState == state()); @@ -472,12 +482,20 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds bool MMF::AbstractMediaPlayer::isProgressiveDownload() const { +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD return (0 != m_download); +#else + return false; +#endif } bool MMF::AbstractMediaPlayer::progressiveDownloadStalled() const { +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD return m_downloadStalled; +#else + return false; +#endif } //----------------------------------------------------------------------------- @@ -547,6 +565,7 @@ void MMF::AbstractMediaPlayer::startPlayback() void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled() { +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD TRACE_CONTEXT(AbstractMediaPlayer::setProgressiveDownloadStalled, EAudioApi); TRACE_ENTRY("state %d", state()); Q_ASSERT(isProgressiveDownload()); @@ -555,7 +574,6 @@ void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled() bufferingStarted(); // Video player loses window handle when closed - need to reapply it here videoOutputChanged(); -#ifdef QT_PHONON_MMF_DOWNLOAD_DUMMY m_download->resume(); #endif } @@ -569,6 +587,7 @@ void MMF::AbstractMediaPlayer::bufferStatusTick() emit MMF::AbstractPlayer::bufferStatus(status); } +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD void MMF::AbstractMediaPlayer::downloadLengthChanged(qint64 length) { TRACE_CONTEXT(AbstractMediaPlayer::downloadLengthChanged, EAudioApi); @@ -611,6 +630,7 @@ void MMF::AbstractMediaPlayer::downloadStateChanged(Download::State state) break; } } +#endif // PHONON_MMF_PROGRESSIVE_DOWNLOAD Phonon::State MMF::AbstractMediaPlayer::phononState(PrivateState state) const { diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index 99fc101..c3b4528 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -23,7 +23,9 @@ along with this library. If not, see . #include #include #include "abstractplayer.h" -#include "download.h" +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD +# include "download.h" +#endif class RFile; @@ -118,8 +120,10 @@ private: private Q_SLOTS: void positionTick(); void bufferStatusTick(); +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD void downloadLengthChanged(qint64); void downloadStateChanged(Download::State); +#endif private: MediaObject *const m_parent; @@ -140,9 +144,10 @@ private: // Used for playback of resource files TPtrC8 m_buffer; - // Used for progressive download +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD Download *m_download; bool m_downloadStalled; +#endif QMultiMap m_metaData; diff --git a/src/3rdparty/phonon/mmf/download.h b/src/3rdparty/phonon/mmf/download.h index b57348b..bda7963 100644 --- a/src/3rdparty/phonon/mmf/download.h +++ b/src/3rdparty/phonon/mmf/download.h @@ -70,8 +70,6 @@ public: const QUrl &sourceUrl() const; const QString &targetFileName() const; void start(); - - // Only has effect when QT_PHONON_MMF_DOWNLOAD_DUMMY is defined void resume(); enum State { diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 902354f..ac11188 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -36,7 +36,6 @@ symbian { $$PHONON_MMF_DIR/backend.h \ $$PHONON_MMF_DIR/bassboost.h \ $$PHONON_MMF_DIR/defs.h \ - $$PHONON_MMF_DIR/download.h \ $$PHONON_MMF_DIR/dummyplayer.h \ $$PHONON_MMF_DIR/effectfactory.h \ $$PHONON_MMF_DIR/effectparameter.h \ @@ -62,7 +61,6 @@ symbian { $$PHONON_MMF_DIR/abstractvideoplayer.cpp \ $$PHONON_MMF_DIR/backend.cpp \ $$PHONON_MMF_DIR/bassboost.cpp \ - $$PHONON_MMF_DIR/download.cpp \ $$PHONON_MMF_DIR/dummyplayer.cpp \ $$PHONON_MMF_DIR/effectfactory.cpp \ $$PHONON_MMF_DIR/effectparameter.cpp \ @@ -77,25 +75,37 @@ symbian { $$PHONON_MMF_DIR/utils.cpp \ $$PHONON_MMF_DIR/videowidget.cpp - # Test for whether the build environment supports video rendering to graphics - # surfaces. - symbian:exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) { - HEADERS += \ - $$PHONON_MMF_DIR/videooutput_surface.h \ - $$PHONON_MMF_DIR/videoplayer_surface.h - SOURCES += \ - $$PHONON_MMF_DIR/videooutput_surface.cpp \ - $$PHONON_MMF_DIR/videoplayer_surface.cpp - DEFINES += PHONON_MMF_VIDEO_SURFACES - } else { - HEADERS += \ - $$PHONON_MMF_DIR/ancestormovemonitor.h \ - $$PHONON_MMF_DIR/videooutput_dsa.h \ - $$PHONON_MMF_DIR/videoplayer_dsa.h - SOURCES += \ - $$PHONON_MMF_DIR/ancestormovemonitor.cpp \ - $$PHONON_MMF_DIR/videooutput_dsa.cpp \ - $$PHONON_MMF_DIR/videoplayer_dsa.cpp \ + symbian { + # Test for whether the build environment supports video rendering to graphics + # surfaces. + exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) { + HEADERS += \ + $$PHONON_MMF_DIR/videooutput_surface.h \ + $$PHONON_MMF_DIR/videoplayer_surface.h + SOURCES += \ + $$PHONON_MMF_DIR/videooutput_surface.cpp \ + $$PHONON_MMF_DIR/videoplayer_surface.cpp + DEFINES += PHONON_MMF_VIDEO_SURFACES + } else { + HEADERS += \ + $$PHONON_MMF_DIR/ancestormovemonitor.h \ + $$PHONON_MMF_DIR/videooutput_dsa.h \ + $$PHONON_MMF_DIR/videoplayer_dsa.h + SOURCES += \ + $$PHONON_MMF_DIR/ancestormovemonitor.cpp \ + $$PHONON_MMF_DIR/videooutput_dsa.cpp \ + $$PHONON_MMF_DIR/videoplayer_dsa.cpp \ + } + + # Test whether the build environment includes support for the Download Manager + # API, required for Progressive Download + exists($${EPOCROOT}epoc32/include/downloadmgrclient.h) | \ + exists($${EPOCROOT}epoc32/include/mw/downloadmgrclient.h) { + HEADERS += $$PHONON_MMF_DIR/download.h + SOURCES += $$PHONON_MMF_DIR/download.cpp + LIBS += -ldownloadmgr + DEFINES += PHONON_MMF_PROGRESSIVE_DOWNLOAD + } } LIBS += -lcone @@ -113,7 +123,6 @@ symbian { LIBS += -lapgrfx -lapmime # For recognizer LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream - LIBS += -ldownloadmgr # These are for effects. LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect -- cgit v0.12 From c2ed7b0cb9b9db105c650301af5bd3199cdd032e Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 4 Oct 2010 09:32:42 +0200 Subject: Got rid of "No such directory" warning when shadow building. RevBy: Thomas Zander --- configure | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 53f520a..f7904d9 100755 --- a/configure +++ b/configure @@ -4902,9 +4902,8 @@ case "$XPLATFORM" in *symbian*) # Raptor does not support configure tests. # the main commands needed to compile; - (cd config.tests/symbian - mkdir -p rcomp - cd rcomp + (mkdir -p config.tests/symbian/rcomp + cd config.tests/symbian/rcomp rm -f rcomp_test.rsg touch rcomp_test.rpp rcomp_test.rsc rcomp_test.rss rcomp -u -m045,046,047 -s./rcomp_test.rpp -o./rcomp_test.rsc -h./rcomp_test.rsg -i./rcomp_test.rss 2>&1 > /dev/null -- cgit v0.12 From 9dae9599c4d19ca55693df0b81bacbc1255ec733 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 4 Oct 2010 09:33:20 +0200 Subject: Made scripttools disabled on Symbian by default, like on Windows. RevBy: Miikka Heikkinen --- configure | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure b/configure index f7904d9..aca3467 100755 --- a/configure +++ b/configure @@ -7224,7 +7224,14 @@ if [ "$CFG_SCRIPTTOOLS" = "yes" -a "$CFG_SCRIPT" = "no" ]; then exit 1 fi if [ "$CFG_SCRIPTTOOLS" = "auto" -a "$CFG_SCRIPT" != "no" ]; then - CFG_SCRIPTTOOLS="yes" + case "$XPLATFORM" in + symbian*) + CFG_SCRIPTTOOLS="no" + ;; + *) + CFG_SCRIPTTOOLS="yes" + ;; + esac elif [ "$CFG_SCRIPT" = "no" ]; then CFG_SCRIPTTOOLS="no" fi -- cgit v0.12 From 207d9239dc6b67109b5e8cbdea7e5a589c167e85 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 4 Oct 2010 10:55:11 +0300 Subject: Enable QtOpenGL vector path caching on Symbian/IVE3 IVE3 doesn't support UNSIGNED_INT index values in DrawElements. This patch checks if GL_OES_element_index_uint extensions is supported and determines DrawElement indices type based on that. On desktop environment UNSIGNED_INT is always supported. Task-number: QTBUG-13563 Reviewed-by: Gunnar --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 42 +-- src/opengl/gl2paintengineex/qtriangulator.cpp | 354 ++++++++++++++------- src/opengl/gl2paintengineex/qtriangulator_p.h | 58 +++- src/opengl/qglextensions_p.h | 14 + 4 files changed, 334 insertions(+), 134 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index a81ed8e..a98d7cc 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -646,7 +646,7 @@ struct QGL2PEVectorPathCache GLuint ibo; #else float *vertices; - quint32 *indices; + void *indices; #endif int vertexCount; int indexCount; @@ -696,14 +696,6 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) const QPointF* const points = reinterpret_cast(path.points()); - // ### Remove before release... -#ifdef Q_OS_SYMBIAN - // ### There are some unresolved issues in Symbian vector path caching. - static bool do_vectorpath_cache = false; -#else - static bool do_vectorpath_cache = true; -#endif - // Check to see if there's any hints if (path.shape() == QVectorPath::RectangleHint) { QGLRect rect(points[0].x(), points[0].y(), points[2].x(), points[2].y()); @@ -774,8 +766,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) } else { // printf(" - Marking path as cachable...\n"); // Tag it for later so that if the same path is drawn twice, it is assumed to be static and thus cachable - if (do_vectorpath_cache) - path.makeCacheable(); + path.makeCacheable(); vertexCoordinateArray.clear(); vertexCoordinateArray.addPath(path, inverseScale, false); prepareForDraw(currentBrush.isOpaque()); @@ -828,13 +819,16 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) cache->indexCount = polys.indices.size(); cache->primitiveType = GL_TRIANGLES; cache->iscale = inverseScale; - #ifdef QT_OPENGL_CACHE_AS_VBOS glGenBuffers(1, &cache->vbo); glGenBuffers(1, &cache->ibo); glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint32) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); + + if (glSupportsElementIndexUint) + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint32) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); + else + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint16) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); QVarLengthArray vertices(polys.vertices.size()); for (int i = 0; i < polys.vertices.size(); ++i) @@ -842,8 +836,13 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBufferData(GL_ARRAY_BUFFER, sizeof(float) * vertices.size(), vertices.data(), GL_STATIC_DRAW); #else cache->vertices = (float *) qMalloc(sizeof(float) * polys.vertices.size()); - cache->indices = (quint32 *) qMalloc(sizeof(quint32) * polys.indices.size()); - memcpy(cache->indices, polys.indices.data(), sizeof(quint32) * polys.indices.size()); + if (glSupportsElementIndexUint) { + cache->indices = (quint32 *) qMalloc(sizeof(quint32) * polys.indices.size()); + memcpy(cache->indices, polys.indices.data(), sizeof(quint32) * polys.indices.size()); + } else { + cache->indices = (quint16 *) qMalloc(sizeof(quint16) * polys.indices.size()); + memcpy(cache->indices, polys.indices.data(), sizeof(quint16) * polys.indices.size()); + } for (int i = 0; i < polys.vertices.size(); ++i) cache->vertices[i] = float(inverseScale * polys.vertices.at(i)); #endif @@ -854,19 +853,24 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, 0); - glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, 0); + if (glSupportsElementIndexUint) + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, 0); + else + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_SHORT, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); #else setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, cache->vertices); - glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, cache->indices); + if (glSupportsElementIndexUint) + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, (qint32 *)cache->indices); + else + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_SHORT, (qint16 *)cache->indices); #endif } else { // printf(" - Marking path as cachable...\n"); // Tag it for later so that if the same path is drawn twice, it is assumed to be static and thus cachable - if (do_vectorpath_cache) - path.makeCacheable(); + path.makeCacheable(); // The path is too complicated & needs the stencil technique vertexCoordinateArray.clear(); diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index f14b0a4..ea072b4 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -57,6 +57,9 @@ #include +#include "qgl_p.h" +#include "qglextensions_p.h" + QT_BEGIN_NAMESPACE //#define Q_TRIANGULATOR_DEBUG @@ -185,6 +188,18 @@ sort_loop_end: sort(array + low + 1, count - low - 1); } +template +struct QVertexSet +{ + inline QVertexSet() { } + inline QVertexSet(const QVertexSet &other) : vertices(other.vertices), indices(other.indices) { } + QVertexSet &operator = (const QVertexSet &other) {vertices = other.vertices; indices = other.indices; return *this;} + + // The vertices of a triangle are given by: (x[i[n]], y[i[n]]), (x[j[n]], y[j[n]]), (x[k[n]], y[k[n]]), n = 0, 1, ... + QVector vertices; // [x[0], y[0], x[1], y[1], x[2], ...] + QVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...] +}; + //============================================================================// // QFraction // //============================================================================// @@ -1295,7 +1310,7 @@ inline void QRingBuffer::enqueue(const T &x) //============================================================================// // QTriangulator // //============================================================================// - +template class QTriangulator { public: @@ -1308,7 +1323,7 @@ public: class ComplexToSimple { public: - inline ComplexToSimple(QTriangulator *parent) : m_parent(parent), + inline ComplexToSimple(QTriangulator *parent) : m_parent(parent), m_edges(0), m_events(0), m_splits(0) { } void decompose(); private: @@ -1422,7 +1437,7 @@ public: class SimpleToMonotone { public: - inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent), m_edges(0), m_upperVertex(0) { } + inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent), m_edges(0), m_upperVertex(0) { } void decompose(); private: enum VertexType {MergeVertex, EndVertex, RegularVertex, StartVertex, SplitVertex}; @@ -1431,7 +1446,7 @@ public: { QRBTree::Node *node; int helper, twin, next, previous; - quint32 from, to; + T from, to; VertexType type; bool pointingUp; int upper() const {return (pointingUp ? to : from);} @@ -1478,20 +1493,20 @@ public: class MonotoneToTriangles { public: - inline MonotoneToTriangles(QTriangulator *parent) : m_parent(parent) { } + inline MonotoneToTriangles(QTriangulator *parent) : m_parent(parent) { } void decompose(); private: - inline quint32 indices(int index) const {return m_parent->m_indices.at(index + m_first);} + inline T indices(int index) const {return m_parent->m_indices.at(index + m_first);} inline int next(int index) const {return (index + 1) % m_length;} inline int previous(int index) const {return (index + m_length - 1) % m_length;} - inline bool less(int i, int j) const {return m_parent->m_vertices.at(indices(i)) < m_parent->m_vertices.at(indices(j));} + inline bool less(int i, int j) const {return m_parent->m_vertices.at((qint32)indices(i)) < m_parent->m_vertices.at(indices(j));} inline bool leftOfEdge(int i, int j, int k) const { - return qPointIsLeftOfLine(m_parent->m_vertices.at(indices(i)), - m_parent->m_vertices.at(indices(j)), m_parent->m_vertices.at(indices(k))); + return qPointIsLeftOfLine(m_parent->m_vertices.at((qint32)indices(i)), + m_parent->m_vertices.at((qint32)indices(j)), m_parent->m_vertices.at((qint32)indices(k))); } - QTriangulator *m_parent; + QTriangulator *m_parent; int m_first; int m_length; }; @@ -1505,11 +1520,11 @@ public: // Call this only once. void initialize(const QPainterPath &path, const QTransform &matrix, qreal lod); // Call either triangulate() or polyline() only once. - QTriangleSet triangulate(); - QPolylineSet polyline(); + QVertexSet triangulate(); + QVertexSet polyline(); private: QDataBuffer m_vertices; - QVector m_indices; + QVector m_indices; uint m_hint; }; @@ -1517,7 +1532,8 @@ private: // QTriangulator // //============================================================================// -QTriangleSet QTriangulator::triangulate() +template +QVertexSet QTriangulator::triangulate() { for (int i = 0; i < m_vertices.size(); ++i) { Q_ASSERT(qAbs(m_vertices.at(i).x) < (1 << 21)); @@ -1536,7 +1552,7 @@ QTriangleSet QTriangulator::triangulate() MonotoneToTriangles m2t(this); m2t.decompose(); - QTriangleSet result; + QVertexSet result; result.indices = m_indices; result.vertices.resize(2 * m_vertices.size()); for (int i = 0; i < m_vertices.size(); ++i) { @@ -1546,9 +1562,10 @@ QTriangleSet QTriangulator::triangulate() return result; } -QPolylineSet QTriangulator::polyline() +template +QVertexSet QTriangulator::polyline() { - QPolylineSet result; + QVertexSet result; result.indices = m_indices; result.vertices.resize(2 * m_vertices.size()); for (int i = 0; i < m_vertices.size(); ++i) { @@ -1558,7 +1575,8 @@ QPolylineSet QTriangulator::polyline() return result; } -void QTriangulator::initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix) +template +void QTriangulator::initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix) { m_hint = hint; m_vertices.resize(count); @@ -1570,10 +1588,11 @@ void QTriangulator::initialize(const qreal *polygon, int count, uint hint, const m_vertices.at(i).y = qRound(y * Q_FIXED_POINT_SCALE); m_indices[i] = i; } - m_indices[count] = Q_TRIANGULATE_END_OF_POLYGON; + m_indices[count] = T(-1); //Q_TRIANGULATE_END_OF_POLYGON } -void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix, qreal lod) +template +void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix, qreal lod) { m_hint = path.hints(); // Curved paths will be converted to complex polygons. @@ -1586,10 +1605,10 @@ void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix switch (*e) { case QPainterPath::MoveToElement: if (!m_indices.isEmpty()) - m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + m_indices.push_back(T(-1)); // Q_TRIANGULATE_END_OF_POLYGON // Fall through. case QPainterPath::LineToElement: - m_indices.push_back(quint32(m_vertices.size())); + m_indices.push_back(T(m_vertices.size())); m_vertices.resize(m_vertices.size() + 1); qreal x, y; matrix.map(p[0], p[1], &x, &y); @@ -1607,7 +1626,7 @@ void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix QPolygonF poly = bezier.toPolygon(); // Skip first point, it already exists in 'm_vertices'. for (int j = 1; j < poly.size(); ++j) { - m_indices.push_back(quint32(m_vertices.size())); + m_indices.push_back(T(m_vertices.size())); m_vertices.resize(m_vertices.size() + 1); m_vertices.last().x = qRound(poly.at(j).x() * Q_FIXED_POINT_SCALE / lod); m_vertices.last().y = qRound(poly.at(j).y() * Q_FIXED_POINT_SCALE / lod); @@ -1624,7 +1643,7 @@ void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix } } else { for (int i = 0; i < path.elementCount(); ++i, p += 2) { - m_indices.push_back(quint32(m_vertices.size())); + m_indices.push_back(T(m_vertices.size())); m_vertices.resize(m_vertices.size() + 1); qreal x, y; matrix.map(p[0], p[1], &x, &y); @@ -1632,10 +1651,11 @@ void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix m_vertices.last().y = qRound(y * Q_FIXED_POINT_SCALE); } } - m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + m_indices.push_back(T(-1)); // Q_TRIANGULATE_END_OF_POLYGON } -void QTriangulator::initialize(const QPainterPath &path, const QTransform &matrix, qreal lod) +template +void QTriangulator::initialize(const QPainterPath &path, const QTransform &matrix, qreal lod) { initialize(qtVectorPathForPath(path), matrix, lod); } @@ -1643,8 +1663,8 @@ void QTriangulator::initialize(const QPainterPath &path, const QTransform &matri //============================================================================// // QTriangulator::ComplexToSimple // //============================================================================// - -void QTriangulator::ComplexToSimple::decompose() +template +void QTriangulator::ComplexToSimple::decompose() { m_initialPointCount = m_parent->m_vertices.size(); initEdges(); @@ -1670,17 +1690,18 @@ void QTriangulator::ComplexToSimple::decompose() processed.setBit(i); i = m_edges.at(i).next; // CCW order } while (i != first); - m_parent->m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + m_parent->m_indices.push_back(T(-1)); // Q_TRIANGULATE_END_OF_POLYGON } } -void QTriangulator::ComplexToSimple::initEdges() +template +void QTriangulator::ComplexToSimple::initEdges() { // Initialize edge structure. // 'next' and 'previous' are not being initialized at this point. int first = 0; for (int i = 0; i < m_parent->m_indices.size(); ++i) { - if (m_parent->m_indices.at(i) == Q_TRIANGULATE_END_OF_POLYGON) { + if (m_parent->m_indices.at(i) == T(-1)) { // Q_TRIANGULATE_END_OF_POLYGON if (m_edges.size() != first) m_edges.last().to = m_edges.at(first).from; first = m_edges.size(); @@ -1700,15 +1721,16 @@ void QTriangulator::ComplexToSimple::initEdges() } // Return true if new intersection was found -bool QTriangulator::ComplexToSimple::calculateIntersection(int left, int right) +template +bool QTriangulator::ComplexToSimple::calculateIntersection(int left, int right) { const Edge &e1 = m_edges.at(left); const Edge &e2 = m_edges.at(right); - const QPodPoint &u1 = m_parent->m_vertices.at(e1.from); - const QPodPoint &u2 = m_parent->m_vertices.at(e1.to); - const QPodPoint &v1 = m_parent->m_vertices.at(e2.from); - const QPodPoint &v2 = m_parent->m_vertices.at(e2.to); + const QPodPoint &u1 = m_parent->m_vertices.at((qint32)e1.from); + const QPodPoint &u2 = m_parent->m_vertices.at((qint32)e1.to); + const QPodPoint &v1 = m_parent->m_vertices.at((qint32)e2.from); + const QPodPoint &v2 = m_parent->m_vertices.at((qint32)e2.to); if (qMax(u1.x, u2.x) <= qMin(v1.x, v2.x)) return false; @@ -1734,7 +1756,8 @@ bool QTriangulator::ComplexToSimple::calculateIntersection(int left, int right) return true; } -bool QTriangulator::ComplexToSimple::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const +template +bool QTriangulator::ComplexToSimple::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const { const Edge &leftEdge = m_edges.at(leftEdgeIndex); const Edge &rightEdge = m_edges.at(rightEdgeIndex); @@ -1752,7 +1775,8 @@ bool QTriangulator::ComplexToSimple::edgeIsLeftOfEdge(int leftEdgeIndex, int rig return d < 0; } -QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex) const +template +QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex) const { QRBTree::Node *current = m_edgeList.root; QRBTree::Node *result = 0; @@ -1767,7 +1791,8 @@ QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeInd return result; } -QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex, QRBTree::Node *after) const +template +QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex, QRBTree::Node *after) const { if (!m_edgeList.root) return after; @@ -1782,7 +1807,8 @@ QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeInd return result; } -QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::bounds(const QPodPoint &point) const +template +QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::bounds(const QPodPoint &point) const { QRBTree::Node *current = m_edgeList.root; QPair::Node *, QRBTree::Node *> result(0, 0); @@ -1830,7 +1856,8 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple return result; } -QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::outerBounds(const QPodPoint &point) const +template +QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::outerBounds(const QPodPoint &point) const { QRBTree::Node *current = m_edgeList.root; QPair::Node *, QRBTree::Node *> result(0, 0); @@ -1886,7 +1913,8 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple return result; } -void QTriangulator::ComplexToSimple::splitEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost, int vertex, const QIntersectionPoint &intersectionPoint) +template +void QTriangulator::ComplexToSimple::splitEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost, int vertex, const QIntersectionPoint &intersectionPoint) { Q_ASSERT(leftmost && rightmost); @@ -1904,8 +1932,8 @@ void QTriangulator::ComplexToSimple::splitEdgeListRange(QRBTree::Node *left } } - -void QTriangulator::ComplexToSimple::reorderEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost) +template +void QTriangulator::ComplexToSimple::reorderEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost) { Q_ASSERT(leftmost && rightmost); @@ -1932,7 +1960,8 @@ void QTriangulator::ComplexToSimple::reorderEdgeListRange(QRBTree::Node *le calculateIntersection(storeRightmost->data, rightmost->data); } -void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) +template +void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) { QIntersectionPoint eventPoint2 = qIntersectionPoint(eventPoint); while (!m_topIntersection.isEmpty() && m_topIntersection.top().intersectionPoint < eventPoint2) { @@ -1949,8 +1978,8 @@ void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) if (!previous) break; const Edge &edge = m_edges.at(previous->data); - const QPodPoint &u = m_parent->m_vertices.at(edge.from); - const QPodPoint &v = m_parent->m_vertices.at(edge.to); + const QPodPoint &u = m_parent->m_vertices.at((qint32)edge.from); + const QPodPoint &v = m_parent->m_vertices.at((qint32)edge.to); if (!currentIntersectionPoint.isOnLine(u, v)) { Q_ASSERT(!currentIntersectionPoint.isAccurate() || qCross(currentIntersectionPoint.upperLeft - u, v - u) != 0); break; @@ -1963,8 +1992,8 @@ void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) if (!next) break; const Edge &edge = m_edges.at(next->data); - const QPodPoint &u = m_parent->m_vertices.at(edge.from); - const QPodPoint &v = m_parent->m_vertices.at(edge.to); + const QPodPoint &u = m_parent->m_vertices.at((qint32)edge.from); + const QPodPoint &v = m_parent->m_vertices.at((qint32)edge.to); if (!currentIntersectionPoint.isOnLine(u, v)) { Q_ASSERT(!currentIntersectionPoint.isAccurate() || qCross(currentIntersectionPoint.upperLeft - u, v - u) != 0); break; @@ -1987,7 +2016,8 @@ void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) } } -void QTriangulator::ComplexToSimple::fillPriorityQueue() +template +void QTriangulator::ComplexToSimple::fillPriorityQueue() { m_events.reset(); m_events.reserve(m_edges.size() * 2); @@ -1995,7 +2025,7 @@ void QTriangulator::ComplexToSimple::fillPriorityQueue() Q_ASSERT(m_edges.at(i).previous == -1 && m_edges.at(i).next == -1); Q_ASSERT(m_edges.at(i).node == 0); Q_ASSERT(m_edges.at(i).pointingUp == m_edges.at(i).originallyPointingUp); - Q_ASSERT(m_edges.at(i).pointingUp == (m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from))); + Q_ASSERT(m_edges.at(i).pointingUp == (m_parent->m_vertices.at(qint32)(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from))); // Ignore zero-length edges. if (m_parent->m_vertices.at(m_edges.at(i).to) != m_parent->m_vertices.at(m_edges.at(i).from)) { QPodPoint upper = m_parent->m_vertices.at(m_edges.at(i).upper()); @@ -2010,7 +2040,8 @@ void QTriangulator::ComplexToSimple::fillPriorityQueue() sort(m_events.data(), m_events.size()); } -void QTriangulator::ComplexToSimple::calculateIntersections() +template +void QTriangulator::ComplexToSimple::calculateIntersections() { fillPriorityQueue(); @@ -2075,7 +2106,8 @@ void QTriangulator::ComplexToSimple::calculateIntersections() // The upper piece is pushed to the end of the 'm_edges' vector. // The lower piece replaces the old edge. // Return the edge whose 'from' is 'pointIndex'. -int QTriangulator::ComplexToSimple::splitEdge(int splitIndex) +template +int QTriangulator::ComplexToSimple::splitEdge(int splitIndex) { const Split &split = m_splits.at(splitIndex); Edge &lowerEdge = m_edges.at(split.edge); @@ -2105,7 +2137,8 @@ int QTriangulator::ComplexToSimple::splitEdge(int splitIndex) } } -bool QTriangulator::ComplexToSimple::splitEdgesAtIntersections() +template +bool QTriangulator::ComplexToSimple::splitEdgesAtIntersections() { for (int i = 0; i < m_edges.size(); ++i) m_edges.at(i).mayIntersect = false; @@ -2122,7 +2155,8 @@ bool QTriangulator::ComplexToSimple::splitEdgesAtIntersections() return checkForNewIntersections; } -void QTriangulator::ComplexToSimple::insertEdgeIntoVectorIfWanted(ShortArray &orderedEdges, int i) +template +void QTriangulator::ComplexToSimple::insertEdgeIntoVectorIfWanted(ShortArray &orderedEdges, int i) { // Edges with zero length should not reach this part. Q_ASSERT(m_parent->m_vertices.at(m_edges.at(i).from) != m_parent->m_vertices.at(m_edges.at(i).to)); @@ -2152,7 +2186,8 @@ void QTriangulator::ComplexToSimple::insertEdgeIntoVectorIfWanted(ShortArray &or orderedEdges.append(i); } -void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() +template +void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() { Q_ASSERT(m_edgeList.root == 0); // Initialize priority queue. @@ -2179,7 +2214,7 @@ void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() while (current != b.second) { Q_ASSERT(current); Q_ASSERT(m_edges.at(current->data).node == current); - Q_ASSERT(qIntersectionPoint(event.point).isOnLine(m_parent->m_vertices.at(m_edges.at(current->data).from), m_parent->m_vertices.at(m_edges.at(current->data).to))); + Q_ASSERT(qIntersectionPoint(event.point).isOnLine(m_parent->m_vertices.at(m_edges.at(current->data).from), m_parent->m_vertices.at(qint32)(m_edges.at(current->data).to))); Q_ASSERT(m_parent->m_vertices.at(m_edges.at(current->data).from) == event.point || m_parent->m_vertices.at(m_edges.at(current->data).to) == event.point); insertEdgeIntoVectorIfWanted(orderedEdges, current->data); current = m_edgeList.next(current); @@ -2290,7 +2325,8 @@ void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() } // end while } -void QTriangulator::ComplexToSimple::removeUnusedPoints() { +template +void QTriangulator::ComplexToSimple::removeUnusedPoints() { QBitArray used(m_parent->m_vertices.size(), false); for (int i = 0; i < m_edges.size(); ++i) { Q_ASSERT((m_edges.at(i).previous == -1) == (m_edges.at(i).next == -1)); @@ -2314,7 +2350,8 @@ void QTriangulator::ComplexToSimple::removeUnusedPoints() { } } -bool QTriangulator::ComplexToSimple::CompareEdges::operator () (int i, int j) const +template +bool QTriangulator::ComplexToSimple::CompareEdges::operator () (int i, int j) const { int cmp = comparePoints(m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(i).from), m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(j).from)); @@ -2325,7 +2362,8 @@ bool QTriangulator::ComplexToSimple::CompareEdges::operator () (int i, int j) co return cmp > 0; } -inline bool QTriangulator::ComplexToSimple::Event::operator < (const Event &other) const +template +inline bool QTriangulator::ComplexToSimple::Event::operator < (const Event &other) const { if (point == other.point) return type < other.type; // 'Lower' has higher priority than 'Upper'. @@ -2337,8 +2375,8 @@ inline bool QTriangulator::ComplexToSimple::Event::operator < (const Event &othe //============================================================================// #ifdef Q_TRIANGULATOR_DEBUG - -QTriangulator::ComplexToSimple::DebugDialog::DebugDialog(ComplexToSimple *parent, int currentVertex) +template +QTriangulator::ComplexToSimple::DebugDialog::DebugDialog(ComplexToSimple *parent, int currentVertex) : m_parent(parent), m_vertex(currentVertex) { QDataBuffer &vertices = m_parent->m_parent->m_vertices; @@ -2360,7 +2398,8 @@ QTriangulator::ComplexToSimple::DebugDialog::DebugDialog(ComplexToSimple *parent m_window = QRectF(minX - border, minY - border, (maxX - minX + 2 * border), (maxY - minY + 2 * border)); } -void QTriangulator::ComplexToSimple::DebugDialog::paintEvent(QPaintEvent *) +template +void QTriangulator::ComplexToSimple::DebugDialog::paintEvent(QPaintEvent *) { QPainter p(this); p.setRenderHint(QPainter::Antialiasing, true); @@ -2426,7 +2465,8 @@ void QTriangulator::ComplexToSimple::DebugDialog::paintEvent(QPaintEvent *) } } -void QTriangulator::ComplexToSimple::DebugDialog::wheelEvent(QWheelEvent *event) +template +void QTriangulator::ComplexToSimple::DebugDialog::wheelEvent(QWheelEvent *event) { qreal scale = exp(-0.001 * event->delta()); QPointF center = m_window.center(); @@ -2436,7 +2476,8 @@ void QTriangulator::ComplexToSimple::DebugDialog::wheelEvent(QWheelEvent *event) update(); } -void QTriangulator::ComplexToSimple::DebugDialog::mouseMoveEvent(QMouseEvent *event) +template +void QTriangulator::ComplexToSimple::DebugDialog::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() & Qt::LeftButton) { QPointF delta = event->pos() - m_lastMousePos; @@ -2449,7 +2490,8 @@ void QTriangulator::ComplexToSimple::DebugDialog::mouseMoveEvent(QMouseEvent *ev } } -void QTriangulator::ComplexToSimple::DebugDialog::mousePressEvent(QMouseEvent *event) +template +void QTriangulator::ComplexToSimple::DebugDialog::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) m_lastMousePos = event->pos(); @@ -2462,8 +2504,8 @@ void QTriangulator::ComplexToSimple::DebugDialog::mousePressEvent(QMouseEvent *e //============================================================================// // QTriangulator::SimpleToMonotone // //============================================================================// - -void QTriangulator::SimpleToMonotone::decompose() +template +void QTriangulator::SimpleToMonotone::decompose() { setupDataStructures(); removeZeroLengthEdges(); @@ -2482,12 +2524,13 @@ void QTriangulator::SimpleToMonotone::decompose() processed.setBit(i); i = m_edges.at(i).next; } while (i != first); - if (m_parent->m_indices.size() > 0 && m_parent->m_indices.back() != Q_TRIANGULATE_END_OF_POLYGON) - m_parent->m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + if (m_parent->m_indices.size() > 0 && m_parent->m_indices.back() != T(-1)) // Q_TRIANGULATE_END_OF_POLYGON + m_parent->m_indices.push_back(T(-1)); // Q_TRIANGULATE_END_OF_POLYGON } } -void QTriangulator::SimpleToMonotone::setupDataStructures() +template +void QTriangulator::SimpleToMonotone::setupDataStructures() { int i = 0; Edge e; @@ -2505,7 +2548,7 @@ void QTriangulator::SimpleToMonotone::setupDataStructures() m_edges.add(e); ++i; Q_ASSERT(i < m_parent->m_indices.size()); - } while (m_parent->m_indices.at(i) != Q_TRIANGULATE_END_OF_POLYGON); + } while (m_parent->m_indices.at(i) != T(-1)); // Q_TRIANGULATE_END_OF_POLYGON m_edges.last().next = start; m_edges.at(start).previous = m_edges.size() - 1; @@ -2519,7 +2562,8 @@ void QTriangulator::SimpleToMonotone::setupDataStructures() } } -void QTriangulator::SimpleToMonotone::removeZeroLengthEdges() +template +void QTriangulator::SimpleToMonotone::removeZeroLengthEdges() { for (int i = 0; i < m_edges.size(); ++i) { if (m_parent->m_vertices.at(m_edges.at(i).from) == m_parent->m_vertices.at(m_edges.at(i).to)) { @@ -2547,7 +2591,8 @@ void QTriangulator::SimpleToMonotone::removeZeroLengthEdges() } } -void QTriangulator::SimpleToMonotone::fillPriorityQueue() +template +void QTriangulator::SimpleToMonotone::fillPriorityQueue() { m_upperVertex.reset(); m_upperVertex.reserve(m_edges.size()); @@ -2561,7 +2606,8 @@ void QTriangulator::SimpleToMonotone::fillPriorityQueue() //} } -bool QTriangulator::SimpleToMonotone::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const +template +bool QTriangulator::SimpleToMonotone::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const { const Edge &leftEdge = m_edges.at(leftEdgeIndex); const Edge &rightEdge = m_edges.at(rightEdgeIndex); @@ -2575,7 +2621,8 @@ bool QTriangulator::SimpleToMonotone::edgeIsLeftOfEdge(int leftEdgeIndex, int ri } // Returns the rightmost edge not to the right of the given edge. -QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfEdge(int edgeIndex) const +template +QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfEdge(int edgeIndex) const { QRBTree::Node *current = m_edgeList.root; QRBTree::Node *result = 0; @@ -2591,7 +2638,8 @@ QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfEdge(int ed } // Returns the rightmost edge left of the given point. -QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfPoint(int pointIndex) const +template +QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfPoint(int pointIndex) const { QRBTree::Node *current = m_edgeList.root; QRBTree::Node *result = 0; @@ -2609,7 +2657,8 @@ QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfPoint(int p return result; } -void QTriangulator::SimpleToMonotone::classifyVertex(int i) +template +void QTriangulator::SimpleToMonotone::classifyVertex(int i) { Edge &e2 = m_edges.at(i); const Edge &e1 = m_edges.at(e2.previous); @@ -2638,13 +2687,15 @@ void QTriangulator::SimpleToMonotone::classifyVertex(int i) } } -void QTriangulator::SimpleToMonotone::classifyVertices() +template +void QTriangulator::SimpleToMonotone::classifyVertices() { for (int i = 0; i < m_edges.size(); ++i) classifyVertex(i); } -bool QTriangulator::SimpleToMonotone::pointIsInSector(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2, const QPodPoint &v3) +template +bool QTriangulator::SimpleToMonotone::pointIsInSector(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2, const QPodPoint &v3) { bool leftOfPreviousEdge = !qPointIsLeftOfLine(p, v2, v1); bool leftOfNextEdge = !qPointIsLeftOfLine(p, v3, v2); @@ -2655,7 +2706,8 @@ bool QTriangulator::SimpleToMonotone::pointIsInSector(const QPodPoint &p, const return leftOfPreviousEdge || leftOfNextEdge; } -bool QTriangulator::SimpleToMonotone::pointIsInSector(int vertex, int sector) +template +bool QTriangulator::SimpleToMonotone::pointIsInSector(int vertex, int sector) { const QPodPoint ¢er = m_parent->m_vertices.at(m_edges.at(sector).from); // Handle degenerate edges. @@ -2677,7 +2729,8 @@ bool QTriangulator::SimpleToMonotone::pointIsInSector(int vertex, int sector) return pointIsInSector(p, v1, center, v3); } -int QTriangulator::SimpleToMonotone::findSector(int edge, int vertex) +template +int QTriangulator::SimpleToMonotone::findSector(int edge, int vertex) { while (!pointIsInSector(vertex, edge)) { edge = m_edges.at(m_edges.at(edge).previous).twin; @@ -2686,7 +2739,8 @@ int QTriangulator::SimpleToMonotone::findSector(int edge, int vertex) return edge; } -void QTriangulator::SimpleToMonotone::createDiagonal(int lower, int upper) +template +void QTriangulator::SimpleToMonotone::createDiagonal(int lower, int upper) { lower = findSector(lower, upper); upper = findSector(upper, lower); @@ -2713,7 +2767,8 @@ void QTriangulator::SimpleToMonotone::createDiagonal(int lower, int upper) m_edges.add(e); } -void QTriangulator::SimpleToMonotone::monotoneDecomposition() +template +void QTriangulator::SimpleToMonotone::monotoneDecomposition() { if (m_edges.isEmpty()) return; @@ -2729,8 +2784,8 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() Q_ASSERT(i < m_edges.size()); int j = m_edges.at(i).previous; Q_ASSERT(j < m_edges.size()); - m_clockwiseOrder = qPointIsLeftOfLine(m_parent->m_vertices.at(m_edges.at(i).from), - m_parent->m_vertices.at(m_edges.at(j).from), m_parent->m_vertices.at(m_edges.at(i).to)); + m_clockwiseOrder = qPointIsLeftOfLine(m_parent->m_vertices.at((quint32)m_edges.at(i).from), + m_parent->m_vertices.at((quint32)m_edges.at(j).from), m_parent->m_vertices.at((quint32)m_edges.at(i).to)); classifyVertices(); fillPriorityQueue(); @@ -2848,7 +2903,8 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() createDiagonal(diagonals.at(i).first, diagonals.at(i).second); } -bool QTriangulator::SimpleToMonotone::CompareVertices::operator () (int i, int j) const +template +bool QTriangulator::SimpleToMonotone::CompareVertices::operator () (int i, int j) const { if (m_parent->m_edges.at(i).from == m_parent->m_edges.at(j).from) return m_parent->m_edges.at(i).type > m_parent->m_edges.at(j).type; @@ -2859,16 +2915,16 @@ bool QTriangulator::SimpleToMonotone::CompareVertices::operator () (int i, int j //============================================================================// // QTriangulator::MonotoneToTriangles // //============================================================================// - -void QTriangulator::MonotoneToTriangles::decompose() +template +void QTriangulator::MonotoneToTriangles::decompose() { - QVector result; + QVector result; QDataBuffer stack(m_parent->m_indices.size()); m_first = 0; // Require at least three more indices. while (m_first + 3 <= m_parent->m_indices.size()) { m_length = 0; - while (m_parent->m_indices.at(m_first + m_length) != Q_TRIANGULATE_END_OF_POLYGON) { + while (m_parent->m_indices.at(m_first + m_length) != T(-1)) { // Q_TRIANGULATE_END_OF_POLYGON ++m_length; Q_ASSERT(m_first + m_length < m_parent->m_indices.size()); } @@ -2955,39 +3011,115 @@ void QTriangulator::MonotoneToTriangles::decompose() // qTriangulate // //============================================================================// -QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint, const QTransform &matrix) +QTriangleSet qTriangulate(const qreal *polygon, + int count, uint hint, const QTransform &matrix) { - QTriangulator triangulator; - triangulator.initialize(polygon, count, hint, matrix); - return triangulator.triangulate(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QTriangleSet triangleSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(polygon, count, hint, matrix); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUint(vertexSet.indices); + + } else { + QTriangulator triangulator; + triangulator.initialize(polygon, count, hint, matrix); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUshort(vertexSet.indices); + } + return triangleSet; } -QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix, qreal lod) +QTriangleSet qTriangulate(const QVectorPath &path, + const QTransform &matrix, qreal lod) { - QTriangulator triangulator; - triangulator.initialize(path, matrix, lod); - return triangulator.triangulate(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QTriangleSet triangleSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUint(vertexSet.indices); + } else { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUshort(vertexSet.indices); + } + return triangleSet; } -QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix, qreal lod) +QTriangleSet qTriangulate(const QPainterPath &path, + const QTransform &matrix, qreal lod) { - QTriangulator triangulator; - triangulator.initialize(path, matrix, lod); - return triangulator.triangulate(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QTriangleSet triangleSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUint(vertexSet.indices); + } else { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUshort(vertexSet.indices); + } + return triangleSet; } -QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix, qreal lod) +QPolylineSet qPolyline(const QVectorPath &path, + const QTransform &matrix, qreal lod) { - QTriangulator triangulator; - triangulator.initialize(path, matrix, lod); - return triangulator.polyline(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QPolylineSet polyLineSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.polyline(); + polyLineSet.vertices = vertexSet.vertices; + polyLineSet.indices.setDataUint(vertexSet.indices); + } else { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + polyLineSet.vertices = vertexSet.vertices; + polyLineSet.indices.setDataUshort(vertexSet.indices); + } + return polyLineSet; } -QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix, qreal lod) +QPolylineSet qPolyline(const QPainterPath &path, + const QTransform &matrix, qreal lod) { - QTriangulator triangulator; - triangulator.initialize(path, matrix, lod); - return triangulator.polyline(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QPolylineSet polyLineSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.polyline(); + polyLineSet.vertices = vertexSet.vertices; + polyLineSet.indices.setDataUint(vertexSet.indices); + } else { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + polyLineSet.vertices = vertexSet.vertices; + polyLineSet.indices.setDataUshort(vertexSet.indices); + } + return polyLineSet; } QT_END_NAMESPACE diff --git a/src/opengl/gl2paintengineex/qtriangulator_p.h b/src/opengl/gl2paintengineex/qtriangulator_p.h index e5eec39..8f96e9f 100644 --- a/src/opengl/gl2paintengineex/qtriangulator_p.h +++ b/src/opengl/gl2paintengineex/qtriangulator_p.h @@ -58,7 +58,58 @@ QT_BEGIN_NAMESPACE -#define Q_TRIANGULATE_END_OF_POLYGON quint32(-1) +class QVertexIndexVector +{ +public: + enum Type { + UnsignedInt, + UnsignedShort + }; + + inline Type type() const { return t; } + + inline void setDataUint(const QVector &data) + { + t = UnsignedInt; + indices32 = data; + } + + inline void setDataUshort(const QVector &data) + { + t = UnsignedShort; + indices16 = data; + } + + inline const void* data() const + { + if (t == UnsignedInt) + return indices32.data(); + return indices16.data(); + } + + inline int size() const + { + if (t == UnsignedInt) + return indices32.size(); + return indices16.size(); + } + + inline QVertexIndexVector &operator = (const QVertexIndexVector &other) + { + if (t == UnsignedInt) + indices32 = other.indices32; + else + indices16 = other.indices16; + + return *this; + } + +private: + + Type t; + QVector indices32; + QVector indices16; +}; struct QTriangleSet { @@ -68,7 +119,7 @@ struct QTriangleSet // The vertices of a triangle are given by: (x[i[n]], y[i[n]]), (x[j[n]], y[j[n]]), (x[k[n]], y[k[n]]), n = 0, 1, ... QVector vertices; // [x[0], y[0], x[1], y[1], x[2], ...] - QVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...] + QVertexIndexVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...] }; struct QPolylineSet @@ -78,8 +129,7 @@ struct QPolylineSet QPolylineSet &operator = (const QPolylineSet &other) {vertices = other.vertices; indices = other.indices; return *this;} QVector vertices; // [x[0], y[0], x[1], y[1], x[2], ...] - QVector indices; - + QVertexIndexVector indices; }; // The vertex coordinates of the returned triangle set will be rounded to a grid with a mesh size diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index 6259cca..e81e849 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -346,6 +346,17 @@ struct QGLExtensionFuncs qt_glEGLImageTargetTexture2DOES = 0; qt_glEGLImageTargetRenderbufferStorageOES = 0; #endif + + // OES_element_index_uint +#if !defined(QT_OPENGL_ES) + qt_glSupportsElementIndexUint = true; +#else + QString extensions = reinterpret_cast(glGetString(GL_EXTENSIONS)); + if (extensions.contains("GL_OES_element_index_uint")) + qt_glSupportsElementIndexUint = true; + else + qt_glSupportsElementIndexUint = false; +#endif } @@ -473,6 +484,7 @@ struct QGLExtensionFuncs _glEGLImageTargetRenderbufferStorageOES qt_glEGLImageTargetRenderbufferStorageOES; #endif + bool qt_glSupportsElementIndexUint; }; @@ -871,6 +883,8 @@ struct QGLExtensionFuncs #define glEGLImageTargetRenderbufferStorageOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetRenderbufferStorageOES #endif +#define glSupportsElementIndexUint QGLContextPrivate::extensionFuncs(ctx).qt_glSupportsElementIndexUint + extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx); bool qt_resolve_buffer_extensions(QGLContext *ctx); -- cgit v0.12 From 77a92b39b30bf14f6509dfb578bad8511ef9a32e Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 4 Oct 2010 09:34:07 +0200 Subject: Made javascriptcore depend on corelib. It lists "QT = core" in its profile, and may fail parallel builds if the dependency is not in place. RevBy: Benjamin Poulain --- src/src.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/src.pro b/src/src.pro index 9a8b70fc..060f48b 100644 --- a/src/src.pro +++ b/src/src.pro @@ -119,7 +119,10 @@ src_webkit_declarative.target = sub-webkitdeclarative src_webkit.depends = src_gui src_sql src_network contains(QT_CONFIG, xmlpatterns): src_webkit.depends += src_xmlpatterns src_imports.depends += src_webkit - exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro): src_webkit.depends += src_javascriptcore + exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro) { + src_webkit.depends += src_javascriptcore + src_javascriptcore.depends = src_corelib + } } contains(QT_CONFIG, qt3support): src_plugins.depends += src_qt3support contains(QT_CONFIG, dbus):{ -- cgit v0.12 From 4207bded6577f24fb4c20cc84880fd48eb9c0c9b Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 4 Oct 2010 10:46:14 +0200 Subject: Fixed library ordering when linking to qtmain. Done-with: Liang Qi Reviewed-by: Trust me --- mkspecs/features/symbian/symbian_building.prf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf index 539609d..614fb65 100644 --- a/mkspecs/features/symbian/symbian_building.prf +++ b/mkspecs/features/symbian/symbian_building.prf @@ -187,9 +187,11 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") { linux-armcc: { QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\) QMAKE_LIBS += -leexe.lib\\(uc_exe_.o\\) - contains(CONFIG, "qt"):contains(QT, "core") { #if linking with QtCore + contains(CONFIG, "qt"):contains(QT, "gui") { #if linking with QtCore + QMAKE_LIBS -= -lqtmain$${QT_LIBINFIX}.lib QMAKE_LIBS += -lqtmain$${QT_LIBINFIX}.lib } else { + QMAKE_LIBS -= -llibcrt0.lib QMAKE_LIBS += -llibcrt0.lib } } else :linux-gcce { @@ -197,9 +199,12 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") { QMAKE_LIBS += \ -l:eexe.lib \ -l:usrt2_2.lib - contains(CONFIG, "qt"):contains(QT, "core") { #if linking with QtCore + contains(CONFIG, "qt"):contains(QT, "gui") { #if linking with QtCore + QMAKE_LIBS -= -l:qtmain$${QT_LIBINFIX}.lib QMAKE_LIBS += -l:qtmain$${QT_LIBINFIX}.lib } else { + QMAKE_LIBS -= -l:libcrt0.lib + QMAKE_LIBS -= -l:libcrt0_gcce.lib QMAKE_LIBS += -l:libcrt0_gcce.lib } QMAKE_LIBS += \ -- cgit v0.12 From 0b905d602ffb24b8cad4f09d84a5f762cc6a6603 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 4 Oct 2010 14:27:10 +0300 Subject: My changes for 4.7.1 Reviewed-by: TrustMe --- dist/changes-4.7.1 | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.7.1 b/dist/changes-4.7.1 index 68b23ba..51a10a3 100644 --- a/dist/changes-4.7.1 +++ b/dist/changes-4.7.1 @@ -308,7 +308,7 @@ Qt for Symbian * [QTBUG-4586] Fixed wrong paths in include/ActiveQt/headers.pri. * [QTBUG-11671] Fixed audio-backend detection in configure tests. - - qmake + - qmake & mkspecs * [QTBUG-13523] Added support for using -L notation in the LIBS variable when building with the symbian/linux-armcc or gcce mkspec. * [QTBUG-12851] Fix assertion on Windows when DESTDIR is empty in static @@ -318,6 +318,31 @@ Qt for Symbian .pro file. * [QTBUG-13081] vc[x]proj generators: support /MAP option without file name. + * [QTBUG-13902] Added support for unsigned smart installer package creation. + * [QTBUG-13991] No longer need to manually edit smart installer pkg file for publishing. + * [QT-3949] Load environment.prf from Symbian SDK if it exists there. + * [QTBUG-13499] Provide a way to compile with RVCT 4.0 using generated Makefile. + * [QTBUG-13336] Ignore MAKEFILE variable for Symbian abld and sbsv2 builds. + * [QTBUG-13363] Fix Symbian handling of projects with special characters in TARGET. + * [QTBUG-12762 & QTBUG-13307] Gcce building support for symbian-sbsv2 + * [QTBUG-13147] Added support for DEPLOYMENT.pkg_build_version + * [QTBUG-12884] Fix "installer_sis" and "deploy" targets when TARGET has path. + * [QTBUG-12879] Fix check to remove unnecessary deployments in Symbian. + * [QTBUG-12716] Make bld.inf target in Symbian mkspecs to depend on .pro file. + * [QTBUG-12715] Rename Symbian generated mmp/mk files to include target in filename. + * [QTBUG-12617] Fix package header in cases where VERSION doesn't contain all values. + * Fix run and runonphone targets for projects that have TARGET with path. + * Fix QT_LIBINFIX for QT_PLUGINS_BASE_DIR. + * No longer require PRE_TARGETDEPS items to be absolute for symbian-sbsv2 mkspec. + * Do smart command replacement for commands containing $$QMAKE_* + command variables, such as $$QMAKE_COPY, when generating bld.inf + extensions for QMAKE_EXTRA_* variables for symbian-sbsv2 mkspec. + + - s60installs + * Fixed qsymbianbearer.qtplugin exports in s60installs.pro. + + - patch_capabilities.pl + * [QTBUG-13760] Improved output of patch_capabilities.pl script. - QInputContext * [QTBUG-12949] Fixed a bug where passwords would not be committed when @@ -325,6 +350,23 @@ Qt for Symbian * [QTBUG-13472] Fixed crash in input methods when using symbols menu and numbers only. + - QDesktopWidget + * [QTBUG-14058] Fix QApplication::desktop()->availableGeometry(). + + - QtCore + * [QTBUG-13802] Symbian^4 platform detection for QSysInfo::symbianVersion(). + * [QTBUG-13612] Do not wait for QThread exit when destroying global statics. + * [QT-3895] Change RLibrary handle in QS60PluginResolver to be process wide. + * [QTBUG-11218] Fix QProcessManager destruction. + + - Qt Plugins + * [QT-3949] Remove pre-Symbian3 plugins from Symbian3 and later builds and + Check S60_VERSION instead of existence of certain files in bearer plugin. + + - Demos & Examples + * [QTBUG-13461] Remove some .pro statements left behind after IAP usage cleanup + * [QTBUG-12276] Assigned valid UID3 for fortuneserver example. + Qt for Windows CE ----------------- - Gui -- cgit v0.12 From d203e7d078cc2bb43ccb32282f40cedbffee4095 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 4 Oct 2010 14:12:10 +0200 Subject: Small improvement in the textedit demo We don't need to retrieve the content of the clipboard just to check if it is empty or not - that is quite a heavy operation if the clipboard contains large piece of data. Related to QTBUG-11085 Reviewed-by: Bradley T. Hughes --- demos/textedit/textedit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp index e1f24a1..165c97c 100644 --- a/demos/textedit/textedit.cpp +++ b/demos/textedit/textedit.cpp @@ -262,7 +262,7 @@ void TextEdit::setupEditActions() tb->addAction(a); menu->addAction(a); #ifndef QT_NO_CLIPBOARD - actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); + actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText()); #endif } @@ -681,7 +681,7 @@ void TextEdit::cursorPositionChanged() void TextEdit::clipboardDataChanged() { #ifndef QT_NO_CLIPBOARD - actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); + actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText()); #endif } -- cgit v0.12 From a636fa9006b7f4cb898cdeec38a99c994fd9259e Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 4 Oct 2010 15:10:25 +0200 Subject: Ensure that the underline is only drawn when expected for an accel On Mac, the underline for an accel should not be drawn at all as this is not part of the style guidelines. This ensures that it is not drawn. Autotest included which required a change to drawItemText() to go via the proxy as well so that the autotest would be useful too. Task-number: QTBUG-14172 Reviewed-by: Richard --- src/gui/styles/qmacstyle_mac.mm | 10 ++++---- tests/auto/qstyle/tst_qstyle.cpp | 51 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 671a888..fb31ae4 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3336,6 +3336,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (needText) { QPalette pal = tb->palette; QPalette::ColorRole role = QPalette::NoRole; + if (!proxy()->styleHint(SH_UnderlineShortcut, tb, w)) + alignment |= Qt::TextHideMnemonic; if (down) cr.translate(shiftX, shiftY); if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5 @@ -3353,13 +3355,13 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter role = QPalette::HighlightedText; } } - drawItemText(p, cr, alignment, pal, - tb->state & State_Enabled, tb->text, role); + proxy()->drawItemText(p, cr, alignment, pal, + tb->state & State_Enabled, tb->text, role); if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5 && (tb->state & State_Sunken)) { // Draw a "drop shadow" in earlier versions. - drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment, - tb->palette, tb->state & State_Enabled, tb->text); + proxy()->drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment, + tb->palette, tb->state & State_Enabled, tb->text); } } } else { diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp index a76c82d..ba24225 100644 --- a/tests/auto/qstyle/tst_qstyle.cpp +++ b/tests/auto/qstyle/tst_qstyle.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -146,6 +147,7 @@ private slots: void pixelMetric(); void progressBarChangeStyle(); void defaultFont(); + void testDrawingShortcuts(); private: void lineUpLayoutTest(QStyle *); QWidget *testWidget; @@ -781,5 +783,54 @@ void tst_QStyle::defaultFont() qApp->setFont(defaultFont); } +class DrawTextStyle : public QProxyStyle +{ + Q_OBJECT +public: + DrawTextStyle(QStyle *base = 0) : QProxyStyle(), alignment(0) { setBaseStyle(base); } + void drawItemText(QPainter *painter, const QRect &rect, + int flags, const QPalette &pal, bool enabled, + const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const + { + DrawTextStyle *that = (DrawTextStyle *)this; + that->alignment = flags; + QProxyStyle::drawItemText(painter, rect, flags, pal, enabled, text, textRole); + } + int alignment; +}; + +void tst_QStyle::testDrawingShortcuts() +{ + { + QWidget w; + QToolButton *tb = new QToolButton(&w); + tb->setText("&abc"); + DrawTextStyle *dts = new DrawTextStyle; + w.show(); + tb->setStyle(dts); + QPixmap::grabWidget(tb); + QStyleOptionToolButton sotb; + sotb.initFrom(tb); + bool showMnemonic = dts->styleHint(QStyle::SH_UnderlineShortcut, &sotb, tb); + QVERIFY(dts->alignment & (showMnemonic ? Qt::TextShowMnemonic : Qt::TextHideMnemonic)); + delete dts; + } + { + QToolBar w; + QToolButton *tb = new QToolButton(&w); + tb->setText("&abc"); + DrawTextStyle *dts = new DrawTextStyle; + w.addWidget(tb); + w.show(); + tb->setStyle(dts); + QPixmap::grabWidget(tb); + QStyleOptionToolButton sotb; + sotb.initFrom(tb); + bool showMnemonic = dts->styleHint(QStyle::SH_UnderlineShortcut, &sotb, tb); + QVERIFY(dts->alignment & (showMnemonic ? Qt::TextShowMnemonic : Qt::TextHideMnemonic)); + delete dts; + } +} + QTEST_MAIN(tst_QStyle) #include "tst_qstyle.moc" -- cgit v0.12 From d0d545a751c6b0b37f166c2c77fd3eba4d9b9ddc Mon Sep 17 00:00:00 2001 From: mread Date: Mon, 4 Oct 2010 16:39:25 +0100 Subject: fix for USER: 163 panic found on 5800XM The NO_NAMED_LOCAL_CHUNKS macro should have been set for S605.0 builds. Also for S60 3.2 and Symbian^2. All are added. Reviewed-by: Shane Kearns --- src/corelib/arch/symbian/qt_hybridheap_symbian_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h index 92cfe0e..36c7b6d 100644 --- a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h +++ b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h @@ -90,7 +90,7 @@ // disabling code ported from Symbian^4 that we don't want/can't have in earlier platforms #define QT_SYMBIAN4_ALLOCATOR_UNWANTED_CODE -#if defined(SYMBIAN_VERSION_9_2) || defined(SYMBIAN_VERSION_9_1) +#if defined(SYMBIAN_VERSION_9_1) || defined(SYMBIAN_VERSION_9_2) || defined(SYMBIAN_VERSION_9_3) || defined(SYMBIAN_VERSION_9_4) || defined(SYMBIAN_VERSION_SYMBIAN2) #define NO_NAMED_LOCAL_CHUNKS #endif -- cgit v0.12 From 0ee5619ac77285935317a2a068c90f8c999b3f0d Mon Sep 17 00:00:00 2001 From: axasia Date: Mon, 4 Oct 2010 19:01:41 +0200 Subject: Update japanese translations. Merge-request: 837 Reviewed-by: Oswald Buddenhagen --- translations/assistant_ja.ts | 587 ++++++++++++++++++++++++++- translations/designer_ja.ts | 58 ++- translations/linguist_ja.ts | 924 ++++++++++++++++++++++++++++++++++++++++++- translations/qt_ja.ts | 740 ++++++++++++++++++---------------- translations/qtconfig_ja.ts | 194 --------- translations/qvfb_ja.ts | 110 ------ 6 files changed, 1952 insertions(+), 661 deletions(-) mode change 100644 => 100755 translations/assistant_ja.ts mode change 100644 => 100755 translations/linguist_ja.ts mode change 100644 => 100755 translations/qt_ja.ts diff --git a/translations/assistant_ja.ts b/translations/assistant_ja.ts old mode 100644 new mode 100755 index afebc9a..c449e00 --- a/translations/assistant_ja.ts +++ b/translations/assistant_ja.ts @@ -69,15 +69,15 @@ Reason: Error reading collection file '%1': %2. - コレクションファイル '%1' の読み込み中にエラーが発生しました: %2 + コレクションファイル '%1' の読み込み中にエラーが発生しました: %2。 Error creating collection file '%1': %2. - コレクションファイル '%1' の作成中にエラーが発生しました: %2 + コレクションファイル '%1' の作成中にエラーが発生しました: %2。 Error reading collection file '%1': %2 - コレクションファイル '%1' の読み込み中にエラーが発生しました: %2 + コレクションファイル '%1' の読み込み中にエラーが発生しました: %2 Cannot load sqlite database driver! @@ -120,6 +120,17 @@ Reason: + BookmarkItem + + New Folder + 新しいフォルダ + + + Untitled + タイトルなし + + + BookmarkManager Bookmarks @@ -357,6 +368,60 @@ Reason: CmdLineParser + Usage: assistant [Options] + +-collectionFile file Uses the specified collection + file instead of the default one +-showUrl url Shows the document with the + url. +-enableRemoteControl Enables Assistant to be + remotely controlled. +-show widget Shows the specified dockwidget + which can be "contents", "index", + "bookmarks" or "search". +-activate widget Activates the specified dockwidget + which can be "contents", "index", + "bookmarks" or "search". +-hide widget Hides the specified dockwidget + which can be "contents", "index" + "bookmarks" or "search". +-register helpFile Registers the specified help file + (.qch) in the given collection + file. +-unregister helpFile Unregisters the specified help file + (.qch) from the give collection + file. +-setCurrentFilter filter Set the filter as the active filter. +-remove-search-index Removes the full text search index. +-rebuild-search-index Re-builds the full text search index (potentially slow). +-quiet Does not display any error or + status message. +-help Displays this help. + + 使い方: assistant [オプション] + +-collectionFile file デフォルトのコレクションファイルの代わりに使用する + コレクションファイルを指定します。 +-showUrl url 表示するURLを指定します。 +-enableRemoteControl Assistant をリモートから制御できるようにします。 +-show widget 表示するウィジェット("contents"、"index"、 + "bookmarks"、"search")を指定します。 +-activate widget アクティブにするウィジェット("contents"、 + "index"、"bookmarks"、"search")を指定します。 +-hide widget 表示しないウィジェット("contents"、"index"、 + "bookmarks"、"search")を指定します。 +-register helpFile コレクションファイルに登録する + ヘルプファイル (.qch) を指定します。 +-unregister helpFile コレクションファイルから登録を解除する + ヘルプファイル (.qch) を指定します。 +-setCurrentFilter filter フィルタをアクティブなフィルタとして設定します。 +-remove-search-index 全文検索インデックスを削除します。 +-rebuild-search-index 全文検索インデックスをリビルドします。(時間を要する場合があります) +-quiet エラーやステータスメッセージを表示しません。 +-help このヘルプを表示します。 + + + Unknown option: %1 不明なオプション: %1 @@ -417,6 +482,56 @@ Reason: + ConversionWizard + + Help Conversion Wizard + ヘルプ変換ウィザード + + + Converting %1... + %1 を変換中... + + + Writing help collection file... + ヘルプコレクションファイルに書き出し中... + + + Done. + 完了. + + + + FilesPage + + Form + Form + + + Files: + ファイル: + + + Remove + 削除 + + + Remove All + すべて削除 + + + Unreferenced Files + 参照していないファイル + + + Remove files which are neither referenced by a keyword nor by the TOC. + キーワードと目次のどちらからも参照されていないファイルを削除します。 + + + <p><b>Warning:</b> When removing images or stylesheets, be aware that those files are not directly referenced by the .adp or .dcf file.</p> + <p><b>警告:</b> 画像やスタイルシートを削除する時は、それらが .adp ファイルや .dcf ファイルから直接参照されていないか注意してください。</p> + + + FilterNameDialogClass Add Filter Name @@ -428,6 +543,66 @@ Reason: + FilterPage + + Form + Form + + + Filter attributes for current documentation (comma separated list): + 現在のドキュメントのフィルタ属性 (カンマ区切りリスト): + + + Custom Filters + カスタム フィルタ + + + 1 + 1 + + + 2 + 2 + + + Add + 追加 + + + Remove + 削除 + + + Filter Settings + フィルタ設定 + + + Specify the filter attributes for the documentation. If filter attributes are used, also define a custom filter for it. Both the filter attributes and the custom filters are optional. + ドキュメントのフィルタ属性を指定します。フィルタ属性を使用する場合、使用するカスタムフィルタもあわせて指定する必要があります。フィルタ属性もカスタムフィルタも必須ではありません。 + + + Filter Name + フィルタ名 + + + Filter Attributes + フィルタ属性 + + + The custom filter '%1' is defined multiple times. + カスタムフィルタ '%1' が複数回定義されています。 + + + The attributes for custom filter '%1' are defined multiple times. + カスタムフィルタ '%1' の属性が複数回定義されています。 + + + unfiltered + list of available documentation + フィルタなし + + + FindWidget Previous @@ -451,6 +626,17 @@ Reason: + FinishPage + + Converting File + ファイルを変換中 + + + Creating the new Qt help files from the old ADP file. + 古い ADP ファイルから新しい Qt ヘルプファイルを作成しています。 + + + FontPanel Font @@ -474,6 +660,59 @@ Reason: + GeneralPage + + Form + Form + + + Namespace: + 名前空間: + + + Virtual Folder: + 仮想フォルダ: + + + General Settings + 概要設定 + + + Specify the namespace and the virtual folder for the documentation. + ドキュメントの名前空間や仮想フォルダを指定します。 + + + Namespace Error + 名前空間エラー + + + The namespace contains some invalid characters. + 名前空間にいくつか無効な文字が含まれています。 + + + Virtual Folder Error + 仮想フォルダ エラー + + + The virtual folder contains some invalid characters. + 仮想フォルダにいくつか無効な文字が含まれています。 + + + + HelpEngineWrapper + + Unfiltered + フィルタなし + + + + HelpGenerator + + Warning: %1 + 警告: %1 + + + HelpViewer Help @@ -485,7 +724,7 @@ Reason: <title>about:blank</title> - + <title>about:blank</title> <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> @@ -511,6 +750,40 @@ Reason: + HelpWindow + + <center><b>Wizard Assistant</b></center> + <center><b>ウィザード アシスタント</b></center> + + + + IdentifierPage + + Form + Form + + + Create identifiers + IDを作成 + + + Global prefix: + グローバルな接頭辞: + + + Inherit prefix from file names + ファイル名を受け継いだ接頭辞 + + + Identifiers + ID + + + This page allows you to create identifiers from the keywords found in the .adp or .dcf file. + このページで .adp や .dcf ファイルに見つかったキーワードにIDを付与する事ができます。 + + + IndexWindow &Look for: @@ -526,6 +799,53 @@ Reason: + InputPage + + Form + Form + + + File name: + ファイル名: + + + ... + ... + + + Input File + 取り込むファイルの指定 + + + Specify the .adp or .dcf file you want to convert to the new Qt help project format and/or collection format. + 新たに Qt ヘルプ プロジェクト/コレクションフォーマットに変換したい .adp / .dcf ファイルを指定してください。 + + + Open file + ファイルを開く + + + Qt Help Files (*.adp *.dcf) + Qt ヘルプ ファイル (*.adp *.dcf) + + + File Open Error + ファイル オープン エラー + + + The specified file could not be opened! + 指定されたファイルを開く事ができません! + + + File Parsing Error + ファイル パース エラー + + + Parsing error in line %1! + %1 行目でパース エラーです! + + + InstallDialog Install Documentation @@ -713,6 +1033,10 @@ Reason: ホーム(&H) + <center><h3>%1</h3><p>Version %2</p></center><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p> + <center><h3>%1</h3><p>バージョン %2</p></center><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p> + + Could not register file '%1': %2 ファイル '%1' を登録できませんでした: %2 @@ -854,6 +1178,92 @@ Reason: + OutputPage + + Form + Form + + + Project file name: + プロジェクト ファイル名: + + + Collection file name: + コレクション ファイル名: + + + Output File Names + 出力するファイル名の指定 + + + Specify the file names for the output files. + 出力するファイルのファイル名を指定してください。 + + + Convert... + 変換... + + + Qt Help Project File + Qt ヘルプ プロジェクト ファイル + + + Qt Help Collection Project File + Qt ヘルプ コレクション プロジェクト ファイル + + + The specified file %1 already exist. + +Do you want to remove it? + 指定されたファイル %1 は既に存在します。 + +元々あったファイルを削除しますか? + + + Remove + 削除 + + + Cancel + キャンセル + + + + PathPage + + Form + Form + + + File filters: + ファイル フィルタ: + + + Documentation source file paths: + ドキュメントソースファイルパス: + + + Add + 追加 + + + Remove + 削除 + + + Source File Paths + ソースファイルのパス + + + Specify the paths where the sources files are located. By default, all files in those directories matched by the file filter will be included. + ソースファイルが格納されているパスを指定してください。デフォルトではファイルフィルタに一致したディレクトリ内のすべてのファイルが含まれます。 + + + Source File Path + ソースファイルのパス + + + PreferencesDialog Add Documentation @@ -988,6 +1398,175 @@ Reason: + QCollectionGenerator + + Unknown token at line %1. + %1 行目に未知のトークンがあります。 + + + Unknown token at line %1. Expected "QtHelpCollectionProject". + %1 行目の "QtHelpCollectionProject" が期待される箇所に未知のトークンがあります。 + + + Missing end tags. + 終了タグが不明です。 + + + Missing input or output file for help file generation. + ヘルプファイルを生成する為の入力ファイルまたは出力ファイルが不明です。 + + + Missing output file name. + 出力先ファイル名が不明です。 + + + Qt Collection Generator version 1.0 (Qt %1) + + Qt コレクション ジェネレータ バージョン 1.0 (Qt %1) + + + + Missing collection config file. + コレクション設定ファイルが見つかりません。 + + + +Usage: + +qcollectiongenerator <collection-config-file> [options] + + -o <collection-file> Generates a collection file + called <collection-file>. If + this option is not specified + a default name will be used. + -v Displays the version of + qcollectiongenerator. + + + +使い方: + +qcollectiongenerator <コレクション設定ファイル> [オプション] + + -o <コレクションファイル> <コレクションファイル> という名前で + コレクションファイルを生成します。 + このオプションが指定されていなかった場合は + デフォルトのファイル名が使用されます。 + -v qcollectiongenerator のバージョンを表示します。 + + + + + Could not open %1. + + %1 を開けませんでした。 + + + + Reading collection config file... + + コレクション設定ファイルを読み込んでいます... + + + + Collection config file error: %1 + + コレクション設定ファイル エラー: %1 + + + + Generating help for %1... + + %1 のヘルプを生成しています... + + + + Creating collection file... + + コレクションファイルを作成しています... + + + + The file %1 cannot be overwritten. + + ファイル %1 を上書きできません。 + + + + Cannot open %1. + + %1 を開けません。 + + + + Cannot open referenced image file %1. + + 参照されている画像ファイル %1 を開けません。 + + + + + QHelpGenerator + + Missing output file name. + 出力先ファイル名が不明です。 + + + Qt Help Generator version 1.0 (Qt %1) + + Qt ヘルプ ジェネレータ バージョン 1.0 (Qt %1) + + + + Missing Qt help project file. + Qt ヘルプ プロジェクト ファイルが見つかりません。 + + + +Usage: + +qhelpgenerator <help-project-file> [options] + + -o <compressed-file> Generates a Qt compressed help + file called <compressed-file>. + If this option is not specified + a default name will be used. + -c Checks whether all links in HTML files + point to files in this help project. + -v Displays the version of + qhelpgenerator. + + + +使い方: + +qhelpgenerator <ヘルププロジェクトファイル> [オプション] + + -o <圧縮ファイル> <圧縮ファイル> という名前で Qt 圧縮 ヘルプ + ファイルを生成します。 + このオプションが指定されていなかった場合は + デフォルトのファイル名が使用されます。 + -c HTML ファイル内のすべてのリンクがこのヘルプ + プロジェクト内のファイルを指しているかどうかを + チェックします。 + -v qhelpgenerator のバージョンを表示します。 + + + + + Could not open %1. + + %1 を開けませんでした。 + + + + Could not create output directory: %1 + + 出力ディレクトリを作成できませんでした: %1 + + + + QObject The specified collection file does not exist! diff --git a/translations/designer_ja.ts b/translations/designer_ja.ts index 7e1696f..2eb6cd9 100644 --- a/translations/designer_ja.ts +++ b/translations/designer_ja.ts @@ -25,6 +25,49 @@ + AbstractItemEditor + + Selectable + 選択可能 + + + Editable + 編集可能 + + + DragEnabled + ドラッグ可能 + + + DropEnabled + ドロップ可能 + + + UserCheckable + チェック可能 + + + Enabled + 有効 + + + Tristate + 3択 + + + Unchecked + チェックなし + + + PartiallyChecked + 部分的にチェックあり + + + Checked + チェックあり + + + AddLinkDialog Insert Link @@ -844,6 +887,7 @@ Parsing grid layout minimum size values FormEditorOptionsPage %1 % + Zoom percentage %1 % @@ -969,7 +1013,7 @@ Parsing grid layout minimum size values XX Icon Selected off Sample string to determinate the width for the first column of the list item property browser - + XX Icon Selected off @@ -2502,6 +2546,10 @@ Empty class name passed to widget factory method QtLocalePropertyManager + <Invalid> + <無効> + + %1, %2 %1, %2 @@ -4720,6 +4768,14 @@ Please select another name. 新しくインストールされたカスタムウィジェットプラグインをスキャンします。 + Loaded Plugins + ロード済みプラグイン + + + Failed Plugins + 失敗したプラグイン + + Qt Designer couldn't find any plugins プラグインは見つかりませんでした diff --git a/translations/linguist_ja.ts b/translations/linguist_ja.ts old mode 100644 new mode 100755 index abd32a0..2f948e8 --- a/translations/linguist_ja.ts +++ b/translations/linguist_ja.ts @@ -256,6 +256,186 @@ Will assume a single universal form. + LConvert + + +Usage: + lconvert [options] <infile> [<infile>...] + +lconvert is part of Qt's Linguist tool chain. It can be used as a +stand-alone tool to convert and filter translation data files. +The following file formats are supported: + +%1 +If multiple input files are specified, they are merged with +translations from later files taking precedence. + +Options: + -h + --help Display this information and exit. + + -i <infile> + --input-file <infile> + Specify input file. Use if <infile> might start with a dash. + This option can be used several times to merge inputs. + May be '-' (standard input) for use in a pipe. + + -o <outfile> + --output-file <outfile> + Specify output file. Default is '-' (standard output). + + -if <informat> + --input-format <format> + Specify input format for subsequent <infile>s. + The format is auto-detected from the file name and defaults to 'ts'. + + -of <outformat> + --output-format <outformat> + Specify output format. See -if. + + --input-codec <codec> + Specify encoding for QM and PO input files. Default is 'Latin1' + for QM and 'UTF-8' for PO files. UTF-8 is always tried as well for + QM, corresponding to the possible use of the trUtf8() function. + + --output-codec <codec> + Specify encoding for PO output files. Default is 'UTF-8'. + + --drop-tags <regexp> + Drop named extra tags when writing TS or XLIFF files. + May be specified repeatedly. + + --drop-translations + Drop existing translations and reset the status to 'unfinished'. + Note: this implies --no-obsolete. + + --source-language <language>[_<region>] + Specify/override the language of the source strings. Defaults to + POSIX if not specified and the file does not name it yet. + + --target-language <language>[_<region>] + Specify/override the language of the translation. + The target language is guessed from the file name if this option + is not specified and the file contents name no language yet. + + --no-obsolete + Drop obsolete messages. + + --no-finished + Drop finished messages. + + --sort-contexts + Sort contexts in output TS file alphabetically. + + --locations {absolute|relative|none} + Override how source code references are saved in TS files. + Default is absolute. + + --no-ui-lines + Drop line numbers from references to UI files. + + --verbose + be a bit more verbose + +Long options can be specified with only one leading dash, too. + +Return value: + 0 on success + 1 on command line parse failures + 2 on read failures + 3 on write failures + + +使い方: + lconvert [オプション] <入力ファイル> [<入力ファイル>...] + +lconvert は Qt Linguist ツールチェインの一部です。 +翻訳データファイルを変換したりフィルタリングしたりする事が +できるスタンドアロンのツールです。 +サポートしているファイル形式は以下の通りです: + +%1 +入力ファイルが複数個指定された場合、末尾のファイルほど +優先度が高いものとして翻訳データをマージします。 + +オプション: + -h + --help このヘルプを表示して終了します。 + + -i <入力ファイル> + --input-file <入力ファイル> + 入力ファイルを指定します。<入力ファイル> の指定はダッシュ記号で始まっていてもよいです。 + This option can be used several times to merge inputs. + May be '-' (標準入力) for use in a pipe. + + -o <出力ファイル> + --output-file <出力ファイル> + 出力ファイルを指定します。デフォルトは '-' (標準出力) です。 + + -if <入力形式> + --input-format <入力形式> + 後続の <入力ファイル> の入力形式を指定します。 + 形式はファイル名から自動検知され、デフォルトでは 'ts' となります。 + + -of <出力形式> + --output-format <出力形式> + 出力形式を指定します。-if を参照してください。 + + --input-codec <コーデック> + Specify encoding for QM and PO input files. Default is 'Latin1' + for QM and 'UTF-8' for PO files. UTF-8 is always tried as well for + QM, corresponding to the possible use of the trUtf8() function. + + --output-codec <コーデック> + Specify encoding for PO output files.デフォルトは 'UTF-8' です。 + + --drop-tags <正規表現> + Drop named extra tags when writing TS or XLIFF files. + May be specified repeatedly. + + --drop-translations + Drop existing translations and reset the status to 'unfinished'. + 注意: --no-obsolete と同等です。 + + --source-language <language>[_<region>] + Specify/override the language of the source strings. Defaults to + POSIX if not specified and the file does not name it yet. + + --target-language <language>[_<region>] + Specify/override the language of the translation. + The target language is guessed from the file name if this option + is not specified and the file contents name no language yet. + + --no-obsolete + 未使用のメッセージを取り除きます。 + + --no-finished + 完了しているメッセージを取り除きます。 + + --sort-contexts + 出力する TS ファイル内のコンテキストをアルファベット順にソートします。 + + --locations {absolute|relative|none} + Override how source code references are saved in TS files. + Default is absolute. + + --no-ui-lines + UI ファイルを参照している行番号を取り除きます。 + + --verbose + be a bit more verbose + +長すぎるオプションの指定はダッシュ記号で括る事で1つにできます。 + +戻り値: + 0 成功 + 1 コマンドラインパース失敗 + 2 読み込み失敗 + 3 書き込み失敗 + + + + LRelease Dropped %n message(s) which had no ID. @@ -281,6 +461,735 @@ Will assume a single universal form. %n 件の未翻訳のソーステキストを無視しました + + Usage: + lrelease [options] project-file + lrelease [options] ts-files [-qm qm-file] + +lrelease is part of Qt's Linguist tool chain. It can be used as a +stand-alone tool to convert XML-based translations files in the TS +format into the 'compiled' QM format used by QTranslator objects. + +Options: + -help Display this information and exit + -idbased + Use IDs instead of source strings for message keying + -compress + Compress the QM files + -nounfinished + Do not include unfinished translations + -removeidentical + If the translated text is the same as + the source text, do not include the message + -markuntranslated <prefix> + If a message has no real translation, use the source text + prefixed with the given string instead + -silent + Do not explain what is being done + -version + Display the version of lrelease and exit + + 使い方: + lrelease [オプション] project-file + lrelease [オプション] ts-files [-qm qm-file] + +lrelease is part of Qt's Linguist tool chain. It can be used as a +stand-alone tool to convert XML-based translations files in the TS +format into the 'compiled' QM format used by QTranslator objects. + +オプション: + -help このヘルプを表示して終了します + -idbased + メッセージのキーとして、ソース中の文字列を使用する代わりにIDを使用します + -compress + QM ファイルを圧縮します + -nounfinished + 未完了の翻訳をインクルードしません + -removeidentical + If the translated text is the same as + the source text, do not include the message + -markuntranslated <プレフィクス> + If a message has no real translation, use the source text + prefixed with the given string instead + -silent + 完了した事を通知しません + -version + lrelease のバージョンを表示して終了します + + + + lrelease error: %1 + lrelease エラー: %1 + + + Updating '%1'... + + '%1' を更新しています... + + + + Removing translations equal to source text in '%1'... + + '%1' のソーステキストと等しい翻訳を削除しています... + + + + lrelease error: cannot create '%1': %2 + + lrelease エラー: '%1' を作成できません: %2 + + + + lrelease error: cannot save '%1': %2 + lrelease エラー: '%1' を保存できません: %2 + + + lrelease version %1 + + lrelease バージョン %1 + + + + lrelease error: cannot read project file '%1'. + + lrelease エラー: プロジェクトファイル '%1' が読めません。 + + + + lrelease error: cannot process project file '%1'. + + lrelease エラー: プロジェクトファイル '%1' を処理できません。 + + + + lrelease warning: Met no 'TRANSLATIONS' entry in project file '%1' + + lrelease 警告: プロジェクトファイル '%1' に 'TRANSLATIONS' エントリが見つかりません + + + + + LUpdate + + Parenthesis/bracket/brace mismatch between #if and #else branches; using #if branch + + #if を使っている部分で、#if 〜 #else の間の丸括弧/角括弧/中括弧の個数が一致していません + + + + Parenthesis/brace mismatch between #if and #else branches; using #if branch + + #if を使っている部分で、#if 〜 #else の間の丸括弧/中括弧の個数が一致していません + + + + Unterminated C++ comment + + 終了していないC++ コメント + + + + Unterminated C++ string + + 終了していない C++ 文字列 + + + + Excess closing brace in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で閉じ中括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Excess closing parenthesis in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で閉じ丸括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Excess closing bracket in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で閉じ角括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + circular inclusion of %1 + + %1 を循環インクルードしています + + + + Cannot open %1: %2 + + %1 を開けません: %2 + + + + //% cannot be used with tr() / QT_TR_NOOP(). Ignoring + + //% は tr() または QT_TR_NOOP() と併用できません。無視します + + + + Qualifying with unknown namespace/class %1::%2 + + 未知の名前空間またはクラス %1::%2 で修飾されています + + + + tr() cannot be called without context + + コンテキストなしで tr() は呼び出せません + + + + Class '%1' lacks Q_OBJECT macro + + クラス '%1' は Q_OBJECT マクロが不足しています + + + + It is not recommended to call tr() from within a constructor '%1::%2' + + コンストラクタ '%1::%2' 内での tr() 呼び出しは推奨されていません + + + + //% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring + + //% は translate() または QT_TRANSLATE_NOOP() と併用できません。無視します + + + + //= cannot be used with qtTrId() / QT_TRID_NOOP(). Ignoring + + //= は qtTrId() または QT_TRID_NOOP() と併用できません。無視します + + + + Unexpected character in meta string + + メタ文字列内に予期せぬ文字 + + + + Unterminated meta string + + 終了していない メタ文字列 + + + + Cannot invoke tr() like this + + this のように tr() を呼び出す事はできません + + + + Discarding unconsumed meta data + + 未使用のメタデータを破棄しています + + + + Unbalanced opening brace in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で開き中括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Unbalanced opening parenthesis in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で開き丸括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Unbalanced opening bracket in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で開き角括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Cannot open %1: %2 + %1 を開けません: %2 + + + Unterminated Java comment. + + 終了していない Java コメント。 + + + + Invalid Unicode value. + + 不正な Unicode 値です。 + + + + Unterminated string. + + 終了していない文字列。 + + + + String used in translation can contain only literals concatenated with other literals, not expressions or numbers. + + 翻訳で使用される文字列は、式や数字以外の他のリテラルと連結されたリテラルだけを含む事ができます。 + + + + 'class' must be followed by a class name. + + 'class' に続くのはクラス名でなければなりません。 + + + + Excess closing brace. + + 余分な閉じ括弧です。 + + + + 'package' must be followed by package name. + + 'package' に続くのはパッケージ名でなければなりません。 + + + + Unbalanced opening brace. + + 開き括弧が一致していません。 + + + + Unbalanced opening parenthesis. + + 開き丸括弧が一致していません。 + + + + Usage: + lupdate [options] [project-file]... + lupdate [options] [source-file|path|@lst-file]... -ts ts-files|@lst-file + +lupdate is part of Qt's Linguist tool chain. It extracts translatable +messages from Qt UI files, C++, Java and JavaScript/QtScript source code. +Extracted messages are stored in textual translation source files (typically +Qt TS XML). New and modified messages can be merged into existing TS files. + +Options: + -help Display this information and exit. + -no-obsolete + Drop all obsolete strings. + -extensions <ext>[,<ext>]... + Process files with the given extensions only. + The extension list must be separated with commas, not with whitespace. + Default: '%1'. + -pluralonly + Only include plural form messages. + -silent + Do not explain what is being done. + -no-sort + Do not sort contexts in TS files. + -no-recursive + Do not recursively scan the following directories. + -recursive + Recursively scan the following directories (default). + -I <includepath> or -I<includepath> + Additional location to look for include files. + May be specified multiple times. + -locations {absolute|relative|none} + Specify/override how source code references are saved in TS files. + Default is absolute. + -no-ui-lines + Do not record line numbers in references to UI files. + -disable-heuristic {sametext|similartext|number} + Disable the named merge heuristic. Can be specified multiple times. + -pro <filename> + Name of a .pro file. Useful for files with .pro file syntax but + different file suffix. Projects are recursed into and merged. + -source-language <language>[_<region>] + Specify the language of the source strings for new files. + Defaults to POSIX if not specified. + -target-language <language>[_<region>] + Specify the language of the translations for new files. + Guessed from the file name if not specified. + -ts <ts-file>... + Specify the output file(s). This will override the TRANSLATIONS + and nullify the CODECFORTR from possibly specified project files. + -codecfortr <codec> + Specify the codec assumed for tr() calls. Effective only with -ts. + -version + Display the version of lupdate and exit. + @lst-file + Read additional file names (one per line) from lst-file. + + 使い方: + lupdate [オプション] [プロジェクトファイル]... + lupdate [オプション] [source-file|path|@lst-file]... -ts ts-files|@lst-file + +lupdate は Qt' Linguist ツールチェインの一部です。Qt UI ファイル、C++ 、Java、 +JavaScript/QtScript のソースコードからメッセージを抽出します。 +Extracted messages are stored in textual translation source files (typically +Qt TS XML). 新しく追加されたり変更されたメッセージは既存の TS ファイル内のメッセージから +マージされます。 + +オプション: + -help このヘルプを表示して終了します。 + -no-obsolete + すべての未使用の文字列を取り除きます。 + -extensions <ext>[,<ext>]... + 与えられた拡張子のファイルだけ処理します。 + 拡張子のリストはカンマで区切り、空白スペースを含んではいけません。 + デフォルト: '%1' + -pluralonly + 複数形のメッセージだけインクルードします。 + -silent + 完了した事を通知しません + -no-sort + TS ファイル内のコンテキストをソートしません。 + -no-recursive + ディレクトリ内を再帰的に処理しません。 + -recursive + ディレクトリ内を再帰的に処理します。(デフォルト) + -I <includepath> or -I<includepath> + Additional location to look for include files. + May be specified multiple times. + -locations {absolute|relative|none} + Specify/override how source code references are saved in TS files. + Default is absolute. + -no-ui-lines + UI ファイルを参照する行番号を記録しません。 + -disable-heuristic {sametext|similartext|number} + Disable the named merge heuristic. Can be specified multiple times. + -pro <ファイル名> + .pro ファイルの名前を指定します。Useful for files with .pro file syntax but + different file suffix. Projects are recursed into and merged. + -source-language <language>[_<region>] + Specify the language of the source strings for new files. + Defaults to POSIX if not specified. + -target-language <language>[_<region>] + Specify the language of the translations for new files. + Guessed from the file name if not specified. + -ts <ts-file>... + 出力ファイルを指定します。This will override the TRANSLATIONS + and nullify the CODECFORTR from possibly specified project files. + -codecfortr <codec> + Specify the codec assumed for tr() calls. Effective only with -ts. + -version + lupdate のバージョン情報を表示して終了します。 + @lst-file + Read additional file names (one per line) from lst-file. + + + + lupdate warning: Codec for tr() '%1' disagrees with existing file's codec '%2'. Expect trouble. + + lupdate 警告: tr() '%1' のコーデックと既存のファイルのコーデック '%2' が一致しません。問題が発生したようです。 + + + + lupdate warning: Specified target language '%1' disagrees with existing file's language '%2'. Ignoring. + + lupdate 警告: 指定されたターゲット言語 '%1' と既存のファイルの言語 '%2' が一致しません。無視されます。 + + + + lupdate warning: Specified source language '%1' disagrees with existing file's language '%2'. Ignoring. + + lupdate 警告: 指定されたソース言語 '%1' と既存のファイルの言語 '%2' が一致しません。無視されます。 + + + + Updating '%1'... + + '%1' を更新しています... + + + + Stripping non plural forms in '%1'... + + '%1' 内の複数形以外のメッセージを取り除いています... + + + + lupdate warning: Codec for source '%1' is invalid. Falling back to codec for tr(). + + lupdate 警告: ソース '%1' のコーデックは不正です。コーデックを元に戻します。 + + + + lupdate warning: TS files from command line will override TRANSLATIONS in %1. + + lupdate 警告: コマンドラインで指定された TS ファイルは %1 の TRANSLATIONS を上書きます。 + + + + lupdate warning: TS files from command line prevent recursing into %1. + + lupdate 警告: コマンドラインで指定された TS ファイルは %1 内で再起的に処理するのを妨げます。 + + + + lupdate warning: no TS files specified. Only diagnostics will be produced for '%1'. + + lupdate 警告: TS ファイルが指定されていません。'%1' は診断のみ行われます。 + + + + The option -target-language requires a parameter. + + パラメータに -target-language オプションが必要です。 + + + + The option -source-language requires a parameter. + + パラメータに -source-language オプションが必要です。 + + + + The option -disable-heuristic requires a parameter. + + パラメーターに -disable-heuristic オプションが必要です。 + + + + Invalid heuristic name passed to -disable-heuristic. + + -disable-heuristic に不正なヒューリスティック名が渡されています。 + + + + The option -locations requires a parameter. + + パラメータに -locations オプションが必要です。 + + + + Invalid parameter passed to -locations. + + -locations に不正なパラメータが渡されています。 + + + + The -codecfortr option should be followed by a codec name. + + -codecfortr オプションの後ろに続けてコーデック名があるべきです。 + + + + The -extensions option should be followed by an extension list. + + -extensions オプションの後ろに続けて拡張リストがあるべきです。 + + + + The -pro option should be followed by a filename of .pro file. + + -pro オプションの後ろに続けて .pro ファイルのファイル名があるべきです。 + + + + The -I option should be followed by a path. + + -l オプションの後ろに続けてパスがあるべきです。 + + + + Unrecognized option '%1'. + + '%1' は認識できないオプションです。 + + + + lupdate error: List file '%1' is not readable. + + lupdate エラー: リストファイル '%1' が読めません。 + + + + lupdate warning: For some reason, '%1' is not writable. + + lupdate 警告: いくつかの理由により '%1' は書き込みできません。 + + + + lupdate error: File '%1' has no recognized extension. + + lupdate エラー: ファイル '%1' は拡張として認識できません。 + + + + lupdate error: File '%1' does not exist. + + lupdate エラー: ファイル '%1' が存在しません。 + + + + Scanning directory '%1'... + + ディレクトリ '%1' をスキャンしています... + + + + lupdate warning: -target-language usually only makes sense with exactly one TS file. + + lupdate 警告: -target-language は通常1つの TS ファイルにだけ意味を持ちます。 + + + + lupdate warning: -codecfortr has no effect without -ts. + + lupdate 警告: -ts 指定なしでは -codecfortr は何の効果もありません。 + + + + lupdate warning: no TS files specified. Only diagnostics will be produced. + + lupdate 警告: TS ファイルが指定されていません。診断のみ行われます。 + + + + lupdate error: Both project and source files / include paths specified. + + lupdate エラー: プロジェクトとソースファイルまたはインクルードパスの両方が指定されています。 + + + + Found %n source text(s) (%1 new and %2 already existing) + + + %n 件のソーステキストが見つかりました (新規: %1 件、既存: %2 件) + + + + + Removed %n obsolete entries + + + %n 件の未使用のエントリを削除しました + + + + + Kept %n obsolete entries + + + %n 件の未使用のエントリを残しました + + + + + Number heuristic provided %n translation(s) + + + 数値ヒューリスティックは %n 件の翻訳を提供しました + + + + + Same-text heuristic provided %n translation(s) + + + 同一テキスト ヒューリスティックは %n 件の翻訳を提供しました + + + + + Similar-text heuristic provided %n translation(s) + + + 類似ヒューリスティックは %n 件の翻訳を提供しました + + + + + Illegal character + 無効な文字 + + + Unclosed string at end of line + ファイルの終端までに閉じられていない文字列 + + + Illegal escape squence + 無効なエスケープシーケンス + + + Illegal unicode escape sequence + 無効な Unicode エスケープシーケンス + + + Unclosed comment at end of file + ファイルの終端までに閉じられていないコメント + + + Illegal syntax for exponential number + 指数番号の構文が不正です + + + Identifier cannot start with numeric literal + 識別子の先頭に数字を使用する事はできません + + + Unterminated regular expression literal + 終了していない正規表現リテラル + + + //% cannot be used with %1(). Ignoring + + //% は %1() と併用できません。無視します + + + + %1() requires at least two arguments. + + %1() には最低でも2個の引数が必要です。 + + + + %1(): both arguments must be literal strings. + + %1(): 両方の引数は文字列リテラルである必要があります。 + + + + %1() requires at least one argument. + + %1() は最低でも1個の引数が必要です。 + + + + %1(): text to translate must be a literal string. + + %1(): 翻訳するテキストはリテラル文字列である必要があります。 + + + + //= cannot be used with %1(). Ignoring + + //= は %1() と併用できません。無視します + + + + %1(): identifier must be a literal string. + + %1(): 識別子は文字列リテラルである必要があります。 + + + + Expected + Beginning of the string that contains comma-separated list of expected tokens + 期待されるトークン + + + XML error: Parse error at line %1, column %2 (%3). + XML エラー: %1 行目、%2 列目でパースエラー (%3)。 + + + Parse error in UI file + UI ファイルでパースエラー + MainWindow @@ -918,7 +1827,7 @@ All files (*) Save changes made to this Qt translation source file - この Qt 翻訳ソースファイルに対して行われた変更を保存します。 + この Qt 翻訳ソースファイルに対して行われた変更を保存します Save changes made to this Qt translation source file into a new file. @@ -1279,6 +2188,13 @@ Line: %2 + PhraseBook + + Parse error at line %1, column %2 (%3). + %1 行目、%2 列目でパースエラー (%3)。 + + + PhraseBookBox (New Entry) @@ -1450,6 +2366,12 @@ Line: %2 Qt Linguist 'Phrase Book' Qt Linguist 'フレーズ ブック' + + lupdate version %1 + + lupdate バージョン %1 + + SourceCodeView diff --git a/translations/qt_ja.ts b/translations/qt_ja.ts old mode 100644 new mode 100755 index 0812a64..095631e --- a/translations/qt_ja.ts +++ b/translations/qt_ja.ts @@ -373,52 +373,52 @@ libgstreamer-plugins-base はインストールされていますか。 Decay HF ratio (%) DecayHFRatio: Ratio of high-frequency decay time to the value specified by DecayTime. - + 高周波減衰率 (%) Decay time (ms) DecayTime: Time over which reverberation is diminished. - + 減衰時間 (ms) Density (%) Density Delay between first and subsequent reflections. Note that the S60 platform documentation does not make clear the distinction between this value and the Diffusion value. - + 密度 (%) Diffusion (%) Diffusion: Delay between first and subsequent reflections. Note that the S60 platform documentation does not make clear the distinction between this value and the Density value. - + 拡散度 (%) Reflections delay (ms) ReflectionsDelay: Amount of delay between the arrival the direct path from the source and the arrival of the first reflection. - + 反射遅延 (ms) Reflections level (mB) ReflectionsLevel: Amplitude of reflections. This value is corrected by the RoomLevel to give the final reflection amplitude. - + 反射レベル (mB) Reverb delay (ms) ReverbDelay: Amount of time between arrival of the first reflection and start of the late reverberation. - + リバーブ遅延 (ms) Reverb level (mB) ReverbLevel Amplitude of reverberations. This value is corrected by the RoomLevel to give the final reverberation amplitude. - + リバーブ レベル (mB) Room HF level RoomHFLevel: Amplitude of low-pass filter used to attenuate the high frequency component of reflected sound. - + 高周波室内レベル Room level (mB) RoomLevel: Master volume control for all reflected sound. - + 室内レベル (mB) @@ -1531,7 +1531,7 @@ to Invalid use of namespace - 無効なネームスペースの使用法です + 無効な名前空間の使用法です Not an attached property name @@ -1701,19 +1701,19 @@ to QDeclarativeCompositeTypeManager Resource %1 unavailable - リソース %1 が利用できません + リソース %1 が利用できません Namespace %1 cannot be used as a type - ネームスペース %1 を型として使用することはできません + 名前空間 %1 を型として使用することはできません %1 %2 - %1 %2 + %1 %2 Type %1 unavailable - 型 %1 が利用できません + 型 %1 が利用できません @@ -1801,15 +1801,15 @@ to import "%1" has no qmldir and no namespace - import する "%1" に qmldir もネームスペースもありません + import する "%1" に qmldir も名前空間もありません - %1 is not a namespace - - %1 はネームスペースではありません + - %1 は名前空間ではありません - nested namespaces not allowed - - ネームスペースのネストは許可されていません + - 名前空間のネストは許可されていません local directory @@ -1878,7 +1878,7 @@ to ListElement: cannot contain nested elements - ListElement: ネストしたエレメントは保持できません + ListElement: ネストした要素は保持できません ListElement: cannot use reserved "id" property @@ -1998,19 +1998,19 @@ to Invalid import qualifier ID - import するネームスペースの ID が無効です + import する名前空間の ID が無効です Reserved name "Qt" cannot be used as an qualifier - 予約語 "Qt" を import するネームスペースに使用することはできません + 予約語 "Qt" を import する名前空間に使用することはできません Script import qualifiers must be unique. - スクリプトを import するネームスペースは一意である必要があります。 + スクリプトを import する名前空間は一意である必要があります。 Script import requires a qualifier - スクリプトを import する際にはネームスペースの指定が必要です + スクリプトを import する際には名前空間の指定が必要です Library import requires a version @@ -2097,6 +2097,44 @@ to + QDeclarativeTypeData + + Script %1 unavailable + スクリプト %1 が利用できません + + + Type %1 unavailable + 型 %1 が利用できません + + + Namespace %1 cannot be used as a type + 名前空間 %1 を型として使用することはできません + + + %1 %2 + %1 %2 + + + + QDeclarativeTypeLoader + + Script %1 unavailable + スクリプト %1 が利用できません + + + Type %1 unavailable + 型 %1 が利用できません + + + Namespace %1 cannot be used as a type + 名前空間 %1 を型として使用することはできません + + + %1 %2 + %1 %2 + + + QDeclarativeVME Unable to create object of type %1 @@ -3316,7 +3354,7 @@ Do you want to delete it anyway? QLibrary Could not mmap '%1': %2 - '%1' をメモリにマッピングできませんでした: %2 + '%1' をメモリにマッピングできませんでした: %2 Plugin verification data mismatch in '%1' @@ -3324,7 +3362,7 @@ Do you want to delete it anyway? Could not unmap '%1': %2 - '%1' のマッピングを解除できませんでした: %2 + '%1' のマッピングを解除できませんでした: %2 The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] @@ -3663,7 +3701,7 @@ Do you want to delete it anyway? <p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p><p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://qt.nokia.com/products/licensing">qt.nokia.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://qt.nokia.com/">qt.nokia.com</a> for more information.</p> - + <p>Qt はクロスプラットフォームアプリケーション開発用の C++ ツールキットです。</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p><p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Qt ライセンスについての概要は <a href="http://qt.nokia.com/products/licensing">qt.nokia.com/products/licensing</a> をご覧ください。</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt は Nokia 社の製品です。詳しい情報は <a href="http://qt.nokia.com/">qt.nokia.com</a> をご覧ください。</p> @@ -5751,7 +5789,7 @@ Please choose a different file name. Hot Links - + 人気のリンク Adjust Brightness @@ -5771,15 +5809,15 @@ Please choose a different file name. Back Forward - + 戻る Application Left - + Application Left Application Right - + Application Right Book @@ -5799,7 +5837,7 @@ Please choose a different file name. Clear Grab - + Clear Grab Close @@ -5839,11 +5877,11 @@ Please choose a different file name. Go - + Go iTouch - + iTouch Logoff @@ -5863,7 +5901,7 @@ Please choose a different file name. Menu PB - + Menu PB My Sites @@ -5899,15 +5937,15 @@ Please choose a different file name. Rotate Windows - + Rotate Windows Rotation PB - + Rotation PB Rotation KB - + Rotation KB Save @@ -6023,7 +6061,7 @@ Please choose a different file name. Audio Cycle Track - + Audio Cycle Track Time @@ -6130,7 +6168,7 @@ Please choose a different file name. Toggle Call/Hangup Button that will hang up if we're in call, or make a call if we're not. - + 通話/終話の切替 Flip @@ -6138,7 +6176,7 @@ Please choose a different file name. Voice Dial - Button to trigger voice dialling + Button to trigger voice dialing ボイスダイアル @@ -6238,43 +6276,43 @@ Please choose a different file name. Hangul Start - + Hangul Start Hangul End - + Hangul End Hangul Hanja - + ハングル 漢字 Hangul Jamo - + ハングル 字母 Hangul Romaja - + ハングル ローマ字入力 Hangul Jeonja - + Hangul Jeonja Hangul Banja - + Hangul Banja Hangul PreHanja - + Hangul PreHanja Hangul PostHanja - + Hangul PostHanja Hangul Special - + Hangul Special Ctrl @@ -6469,7 +6507,7 @@ Please choose a different file name. QSslSocket Error creating SSL context (%1) - SSL content の作成に失敗しました (%1) + SSL context の作成に失敗しました (%1) Invalid or empty cipher list (%1) @@ -7223,12 +7261,12 @@ Please choose a different file name. Seek quickly back Media controller element - + 少し戻る Seek quickly forward Media controller element - + 少し進む Indefinite time @@ -7794,7 +7832,7 @@ Please choose a different file name. Sequence ']]>' not allowed in content. - このコンテキストでは、']]>' は許可されていません。 + このコンテンツでは、']]>' は許可されていません。 Encountered incorrectly encoded content. @@ -7944,7 +7982,7 @@ Please choose a different file name. Element %1 can't be serialized because it appears outside the document element. - エレメント %1 はシリアライズできません。このドキュメントの範囲を越えるエレメントを含んでいます。 + 要素 %1 はシリアライズできません。このドキュメントの範囲を越える要素を含んでいます。 Attribute %1 can't be serialized because it appears at the top level. @@ -7952,7 +7990,7 @@ Please choose a different file name. Year %1 is invalid because it begins with %2. - %1 年はむこうです。%2 で始まっています。 + %1 年は無効です。%2 で始まっています。 Day %1 is outside the range %2..%3. @@ -7992,7 +8030,7 @@ Please choose a different file name. %1 is not a valid value of type %2. - %1 は、%2 の型に対して有効な値ではありません。 + %1 は、型 %2 の値として無効です。 When casting to %1 from %2, the source value cannot be %3. @@ -8044,7 +8082,7 @@ Please choose a different file name. %1 is not valid as a value of type %2. - 型 %2 に対して、値 %1 は有効ではありません。 + 値 %1 は、型 %2 の値として無効です。 Ambiguous rule match. @@ -8084,7 +8122,7 @@ Please choose a different file name. In a namespace constructor, the value for a namespace cannot be an empty string. - 名前空間のスントラクトにおいて、空白の文字列を名前空間の値として使用することはできません。 + 名前空間のコンストラクタにおいて、空白の文字列を名前空間の値として使用することはできません。 The prefix must be a valid %1, which %2 is not. @@ -8136,11 +8174,11 @@ Please choose a different file name. No namespace binding exists for the prefix %1 - プレフィックス %1 にバインドされたネームスペースがありません + プレフィックス %1 にバインドされた名前空間がありません No namespace binding exists for the prefix %1 in %2 - %2 におけるプレフィックス %1 にバインディングされたネームスペースが存在しません + %2 におけるプレフィックス %1 にバインディングされた名前空間が存在しません %1 is an invalid %2 @@ -8180,7 +8218,7 @@ Please choose a different file name. %1 is not a valid XML 1.0 character. - %1 は XML 1.0 において有効な文字ではありません。 + %1 は、XML 1.0 文字として無効です。 The root node of the second argument to function %1 must be a document node. %2 is not a document node. @@ -8224,7 +8262,7 @@ Please choose a different file name. %1 is an invalid regular expression pattern: %2 - %1 は有効な正規表現ではありません。: %2 + %1 は有効な正規表現ではありません: %2 %1 is an invalid flag for regular expressions. Valid flags are: @@ -8276,15 +8314,15 @@ Please choose a different file name. W3C XML Schema identity constraint selector - + W3C XML スキーマ ID制約 selector W3C XML Schema identity constraint field - + W3C XML スキーマ ID制約 field A construct was encountered which is disallowed in the current language(%1). - + 現在の言語 (%1) では許可されていない構造が検出されました。 %1 is an unknown schema type. @@ -8488,11 +8526,11 @@ Please choose a different file name. An attribute with name %1 has already appeared on this element. - 属性名 '%1' は、すでにこのエレメントで使用されています。 + 属性名 '%1' は、すでにこの要素で使用されています。 A direct element constructor is not well-formed. %1 is ended with %2. - 直積的な指定のエレメントがwell formedではありません。'%1' が、'%2' で終わっています。 + 直積的な指定の要素がwell formedではありません。'%1' が、'%2' で終わっています。 The name %1 does not refer to any schema type. @@ -8520,7 +8558,7 @@ Please choose a different file name. Element %1 is not allowed at this location. - この場所にエレメント '%1' をおくことは許可されていません。 + この場所に要素 %1 をおくことは許可されていません。 Text nodes are not allowed at this location. @@ -8552,31 +8590,31 @@ Please choose a different file name. If element %1 has no attribute %2, it cannot have attribute %3 or %4. - エレメント '%1' が属性 '%2' を持たない場合は、属性 '%3' や '%4' を使用することはできません。 + 要素 '%1' が属性 '%2' を持たない場合は、属性 '%3' や '%4' を使用することはできません。 Element %1 must have at least one of the attributes %2 or %3. - エレメント '%1' は、属性 '%2' か '%3' のいずれかを持たなければなりません。 + 要素 '%1' は、属性 '%2' か '%3' のいずれかを持たなければなりません。 At least one mode must be specified in the %1-attribute on element %2. - エレメント '%2' において、'%1' 属性は少くとも一つのモードを指定しなければなりません。 + 要素 '%2' において、'%1' 属性は少くとも一つのモードを指定しなければなりません。 Element %1 must come last. - エレメント %1 は最後になければなりません。 + 要素 %1 は最後になければなりません。 At least one %1-element must occur before %2. - %2 の前に、少くとも一つは %1 エレメントが存在しなければなりません。 + %2 の前に、少くとも一つは %1 要素が存在しなければなりません。 Only one %1-element can appear. - %1 エレメントは一つのみ存在しなければなりません。 + %1 要素は一つのみ存在しなければなりません。 At least one %1-element must occur inside %2. - %2 の内側には、少くとも一つの '%1' エレメントが存在しなければなりません。 + %2 の内側には、少くとも一つの '%1' 要素が存在しなければなりません。 When attribute %1 is present on %2, a sequence constructor cannot be used. @@ -8584,7 +8622,7 @@ Please choose a different file name. Element %1 must have either a %2-attribute or a sequence constructor. - エレメント %1 には、%2 属性またはsequence constructorがなければなりません。 + 要素 %1 には、%2 属性またはsequence constructorがなければなりません。 When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. @@ -8592,11 +8630,11 @@ Please choose a different file name. Element %1 cannot have children. - エレメント %1 は、子要素を持つことができません。 + 要素 %1 は、子要素を持つことができません。 Element %1 cannot have a sequence constructor. - エレメント %1 は、sequence constructor を含むことができません。 + 要素 %1 は、sequence constructor を含むことができません。 The attribute %1 cannot appear on %2, when it is a child of %3. @@ -8612,11 +8650,11 @@ Please choose a different file name. Top level stylesheet elements must be in a non-null namespace, which %1 isn't. - トップレベルのスタイルシートのエレメントは、non-nullな名前空間を持っていなければなりません。しかし、%1 はそうではありません。 + トップレベルのスタイルシートの要素は、non-nullな名前空間を持っていなければなりません。しかし、%1 はそうではありません。 The value for attribute %1 on element %2 must either be %3 or %4, not %5. - エレメント %2 の属性 %1 の値は、%3 または %4 でなければなりません。%5 は異なります。 + 要素 %2 の属性 %1 の値は、%3 または %4 でなければなりません。%5 は異なります。 Attribute %1 cannot have the value %2. @@ -8624,1083 +8662,1083 @@ Please choose a different file name. The attribute %1 can only appear on the first %2 element. - 属性 %1 は、最初の %2 エレメントにのみ指定できます。 + 属性 %1 は、最初の %2 要素にのみ指定できます。 At least one %1 element must appear as child of %2. - %2 の子要素としては、少くとも一つは %1 エレメントがなければなりません。 + %2 の子要素としては、少くとも一つは %1 要素がなければなりません。 Empty particle cannot be derived from non-empty particle. - 空ではない particle から空の particle を得ることはできません。 + 空ではないパーティクルから空のパーティクルを派生させることはできません。 Derived particle is missing element %1. - 取得した particle に要素 %1 がありません。 + 派生パーティクル に要素 %1 がありません。 Derived element %1 is missing value constraint as defined in base particle. - + 派生要素 %1 は基底パーティクルで値制約が定義されていません。 Derived element %1 has weaker value constraint than base particle. - + 派生要素 %1 は基底パーティクルよりも弱い値制約を持っています。 Fixed value constraint of element %1 differs from value constraint in base particle. - + 要素 %1 の固定値制約は基底パーティクルの値制約と異なっています。 Derived element %1 cannot be nillable as base element is not nillable. - + 基底要素が null を許可していない為、派生要素 %1 に null を許可させる事はできません。 Block constraints of derived element %1 must not be more weaker than in the base element. - + 派生要素 %1 の Block 制約は、基底要素よりも弱くできません。 Simple type of derived element %1 cannot be validly derived from base element. - + 派生要素 %1 の単純型は、基底要素から適切に派生できません。 Complex type of derived element %1 cannot be validly derived from base element. - + 派生要素 %1 の複合型は、基底要素から適切に派生できません。 Element %1 is missing in derived particle. - + 派生パーティクルに要素 %1 がありません。 Element %1 does not match namespace constraint of wildcard in base particle. - + 要素 %1 は基底パーティクルのワイルドカードの名前空間制約にマッチしません。 Wildcard in derived particle is not a valid subset of wildcard in base particle. - + 派生パーティクルにあるワイルドカードは、基底パーティクルのワイルドカードのサブセットとして無効です。 processContent of wildcard in derived particle is weaker than wildcard in base particle. - + 派生パーティクルのワイルドカードの processContent は基底パーティクルのワイルドカードよりも弱いです。 Derived particle allows content that is not allowed in the base particle. - + 派生パーティクルはコンテンツを許可していますが、基底パーティクルでは許可していません。 %1 has inheritance loop in its base type %2. - + %1 は、基底型 %2 で継承ループしています。 Circular inheritance of base type %1. - + 基底型 %1 を循環継承しています。 Circular inheritance of union %1. - + union %1 を循環継承しています。 %1 is not allowed to derive from %2 by restriction as the latter defines it as final. - + %1 は最終的に定義される制約により %2 を派生する事は許可されていません。 %1 is not allowed to derive from %2 by extension as the latter defines it as final. - + %1 は最終的に定義される拡張により %2 を派生する事は許可されていません。 Base type of simple type %1 cannot be complex type %2. - + 単純型 %1 の基底型は複合型 %2 にはできません。 Simple type %1 cannot have direct base type %2. - + 単純型 %1 は基底型 %2 を直接持つ事はできません。 Simple type %1 is not allowed to have base type %2. - + 単純型 %1 は基底型 %2 を持つ事は許可されていません。 Simple type %1 can only have simple atomic type as base type. - + 単純型 %1 は基底型として単純なアトミック型のみ持つ事ができます。 Simple type %1 cannot derive from %2 as the latter defines restriction as final. - + 単純型 %1 は最終的に定義される制約により %2 を派生できません。 Variety of item type of %1 must be either atomic or union. - + %1 の各アイテム型は atomic か union である必要があります。 Variety of member types of %1 must be atomic. - + %1 の各メンバーの型は atomic である必要があります。 %1 is not allowed to derive from %2 by list as the latter defines it as final. - + %1 は最終的に定義されるリストにより %2 を派生する事は許可されていません。 Simple type %1 is only allowed to have %2 facet. - + 単純型 %1 は %2 ファセットのみ持つ事ができます。 Base type of simple type %1 must have variety of type list. - + 単純型 %1 の基底型は各型のリストを持っていなければなりません。 Base type of simple type %1 has defined derivation by restriction as final. - + 単純型 %1 の基底型は最終的に制約により派生として定義されています。 Item type of base type does not match item type of %1. - + 基底型のアイテム型が %1 のアイテム型にマッチしていません。 Simple type %1 contains not allowed facet type %2. - + 単純型 %1 がファセット型 %2 を含む事は許可されていません。 %1 is not allowed to derive from %2 by union as the latter defines it as final. - + %1 は最終的に定義される union により %2 を派生する事は許可されていません。 %1 is not allowed to have any facets. - + %1 はどんなファセットも持つ事を許可されていません。 Base type %1 of simple type %2 must have variety of union. - + 単純型 %2 の基底型 %1 は各型の uinon を持っていなければなりません。 Base type %1 of simple type %2 is not allowed to have restriction in %3 attribute. - + 単純型 %2 の基底型 %1 は %3 属性内に制約を持つ事を許可されていません。 Member type %1 cannot be derived from member type %2 of %3's base type %4. - + メンバ型 %1 は %3 の基底型 %4 のメンバ型 %2 から派生する事はできません。 Derivation method of %1 must be extension because the base type %2 is a simple type. - + %1 の派生メソッドは基底型 %2 が単純型の為、拡張でなければなりません。 Complex type %1 has duplicated element %2 in its content model. - + 複合形 %1 は自身のコンテンツ モデル内で要素 %2 を重複させています。 Complex type %1 has non-deterministic content. - + 複合型 %1 は非決定性コンテンツを所有しています。 Attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3. - + 複合型 %1 の属性は、基底型 %2 の属性の拡張として無効です: %3。 Content model of complex type %1 is not a valid extension of content model of %2. - + 複合型 %1 のコンテンツ モデルは、%2 のコンテンツ モデルの拡張として無効です。 Complex type %1 must have simple content. - + 複合型 %1 は単純コンテンツを持たなければなりません。 Complex type %1 must have the same simple type as its base class %2. - + 複合型 %1 は基底クラス %2 のような単純型を持たなければなりません。 Complex type %1 cannot be derived from base type %2%3. - + 複合型 %1 は基底型 %2 から派生する事はできません %3。 Attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3. - + 複合型 %1 の属性は、基底型 %2 の属性の制約として無効です: %3。 Complex type %1 with simple content cannot be derived from complex base type %2. - + 単純コンテンツの複合型 %1 は複合基底型 %2 を派生する事はできません。 Item type of simple type %1 cannot be a complex type. - + 単純型 %1 のアイテム型を複合型にする事はできません。 Member type of simple type %1 cannot be a complex type. - + 単純型 %1 のメンバー型を複合型にする事はできません。 %1 is not allowed to have a member type with the same name as itself. - + %1 は自身と同名のメンバー型を所有する事を許可していません。 %1 facet collides with %2 facet. - + %1 ファセットと %2 ファセットが衝突しています。 %1 facet must have the same value as %2 facet of base type. - + %1 ファセットは基底型の %2 ファセットと同値を所有しなければなりません。 %1 facet must be equal or greater than %2 facet of base type. - + %1 ファセットは基底型の %2 ファセットと同じかそれ以上でなければなりません。 %1 facet must be less than or equal to %2 facet of base type. - + %1 ファセットは基底型の %2 ファセット以下でなければなりません。 %1 facet contains invalid regular expression - + %1 ファセットは無効な正規表現を含んでいます Unknown notation %1 used in %2 facet. - + 未知の表記法 %1 が %2 ファセットで使われています。 %1 facet contains invalid value %2: %3. - + %1 ファセットは無効な値 %2 を含んでいます: %3。 %1 facet cannot be %2 or %3 if %4 facet of base type is %5. - + %1 ファセットは、%4 ファセットの基底型が %5 の場合に %2 や %3 にする事はできません。 %1 facet cannot be %2 if %3 facet of base type is %4. - + %1 ファセットは、%3 ファセットの基底型が %4 の場合に %2 にする事はできません。 %1 facet must be less than or equal to %2 facet. - + %1 ファセットは %2 ファセット以下でなければなりません。 %1 facet must be less than %2 facet of base type. - + %1 ファセットは基底型の %2 ファセット以下でなければなりません。 %1 facet and %2 facet cannot appear together. - + %1 ファセットと %2 ファセットを同時に現す事はできません。 %1 facet must be greater than %2 facet of base type. - + %1 ファセットは基底型の %2 ファセット以上でなければなりません。 %1 facet must be less than %2 facet. - + %1 ファセットは %2 ファセット以下でなければなりません。 %1 facet must be greater than or equal to %2 facet of base type. - + %1 ファセットは基底型の %2 ファセット以上でなければなりません。 Simple type contains not allowed facet %1. - + 単純型がファセット %1 を含む事は許可されていません。 %1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list. - + list に派生される場合、%1, %2, %3, %4, %5, %6 ファセットは許可されていません。 Only %1 and %2 facets are allowed when derived by union. - + union に派生される場合、%1 と %2 ファセットだけが許可されます。 %1 contains %2 facet with invalid data: %3. - + %1 は無効なデータを含んだ %2 ファセットが含まれています: %3。 Attribute group %1 contains attribute %2 twice. - + 属性グループ %1 は属性 %2 を2重に含んでいます。 Attribute group %1 contains two different attributes that both have types derived from %2. - + 属性グループ %1 はどちらも %2 から派生した型を持つ2つの異なる属性を含んでいます。 Attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3. - + 属性グループ %1 は %3 を継承した型の値制約を持つ属性 %2 を含んでいます。 Complex type %1 contains attribute %2 twice. - + 複合型 %1 は属性 %2 を2回含んでいます。 Complex type %1 contains two different attributes that both have types derived from %2. - + 複合型 %1 はどちらも %2 から派生した型を持つ2つの異なる属性を含んでいます。 Complex type %1 contains attribute %2 that has value constraint but type that inherits from %3. - + 複合型 %1 は %3 を継承した型の値制約を持つ属性 %2 を含んでいます。 Element %1 is not allowed to have a value constraint if its base type is complex. - + 要素 %1 は自身の基底型が複合型の場合に値制約を持つ事を許可されていません。 Element %1 is not allowed to have a value constraint if its type is derived from %2. - + 要素 %1 は、自身が %2 を派生している場合に値制約を持つ事を許可されていません。 Value constraint of element %1 is not of elements type: %2. - + 要素 %1 の値制約は要素型のものではありません: %2。 Element %1 is not allowed to have substitution group affiliation as it is no global element. - + 要素 %1 はグローバル要素ではない代替グループ関係を持つ事を許可されていません。 Type of element %1 cannot be derived from type of substitution group affiliation. - + 要素 %1 の型は代替グループ関係の型を派生する事はできません。 Value constraint of attribute %1 is not of attributes type: %2. - + 属性 %1 の値制約は属性型のものではありません: %2。 Attribute %1 has value constraint but has type derived from %2. - + 属性 %1 は %2 から派生した型を持つ値制約を持っています。 %1 attribute in derived complex type must be %2 like in base type. - + 派生複合型の %1 属性は基底型のように %2 でなければなりません。 Attribute %1 in derived complex type must have %2 value constraint like in base type. - + 派生複合型の属性 %1 は基底型のように %2 値制約を持たなければなりません。 Attribute %1 in derived complex type must have the same %2 value constraint like in base type. - + 派生複合型の属性 %1 は、基底型と同様に %2 値制約を持たなければなりません。 Attribute %1 in derived complex type must have %2 value constraint. - + 派生複合型の属性 %1 は %2 値制約を持たなければなりません。 processContent of base wildcard must be weaker than derived wildcard. - + 基底ワイルドカードの processContent は派生ワイルドカードよりも弱くなければなりません。 Element %1 exists twice with different types. - + 要素 %1 が異なる型で2つ存在しています。 Particle contains non-deterministic wildcards. - + パーティクルは非決定性ワイルドカードを含んでいます。 Base attribute %1 is required but derived attribute is not. - + 基底属性 %1 は必須ですが派生属性はそうなっていません。 Type of derived attribute %1 cannot be validly derived from type of base attribute. - + 派生属性 %1 の型は基底属性の型を有効に派生する事はできません。 Value constraint of derived attribute %1 does not match value constraint of base attribute. - + 派生属性 %1 の値制約は基底属性の値制約にマッチしません。 Derived attribute %1 does not exist in the base definition. - + 派生属性 %1 は基底定義の中に存在しません。 Derived attribute %1 does not match the wildcard in the base definition. - + 派生属性 %1 は基底定義のワイルドカードにマッチしません。 Base attribute %1 is required but missing in derived definition. - + 基底属性 %1 は必須ですが派生定義内に見つかりません。 Derived definition contains an %1 element that does not exists in the base definition - + 派生定義は %1 要素を含んでいますが基底定義内で存在していません Derived wildcard is not a subset of the base wildcard. - + 派生ワイルドカードは基底ワイルドカードのサブセットではありません。 %1 of derived wildcard is not a valid restriction of %2 of base wildcard - + 派生ワイルドカードの %1 は、基底ワイルドカードの %2 の制約として無効です Attribute %1 from base type is missing in derived type. - + 派生型で基底型の属性 %1 が見つかりません。 Type of derived attribute %1 differs from type of base attribute. - + 派生属性 %1 の型が基底属性の型と異なっています。 Base definition contains an %1 element that is missing in the derived definition - + 基底定義は %1 要素を含んでいますが派生定義内で見つかりません Can not process unknown element %1, expected elements are: %2. - + 未知の要素 %1 を処理できません、期待する要素は以下のものです: %2。 Element %1 is not allowed in this scope, possible elements are: %2. - + 要素 %1 はこのスコープ内で許可されていません、使用可能な要素は次のものです: %2。 Child element is missing in that scope, possible child elements are: %1. - + 子要素がそのスコープ内で見つかりません、使用可能な子要素は次のものです: %1。 Document is not a XML schema. - + ドキュメントは XML スキーマではありません。 %1 attribute of %2 element contains invalid content: {%3} is not a value of type %4. - + %2 要素の %1 属性は不正なコンテンツを含んでいます: {%3} は型 %4 の値ではありません。 %1 attribute of %2 element contains invalid content: {%3}. - + %2 要素の %1 属性は不正なコンテンツを含んでいます: {%3}。 Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema. - + インクルードしているスキーマの対象名前空間 %1 はインクルードしようとしているスキーマで定義されている対象名前空間 %2 と異なっています。 Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema. - + インポートしているスキーマの対象名前空間 %1 はインポートしようとしているスキーマで定義されている対象名前空間 %2 と異なっています。 %1 element is not allowed to have the same %2 attribute value as the target namespace %3. - + %1 要素は対象名前空間 %3 として %2 属性値を持つ事を許可されていません。 %1 element without %2 attribute is not allowed inside schema without target namespace. - + %2 属性なし %1 要素は対象名前空間なしのスキーマ内にある事を許可されていません。 %1 element is not allowed inside %2 element if %3 attribute is present. - + %3 属性が存在している場合、%2 要素内で %1 要素は許可されていません。 %1 element has neither %2 attribute nor %3 child element. - + %1 要素は %2 属性も %3 子要素のどちらも持っていません。 %1 element with %2 child element must not have a %3 attribute. - + %2 子要素付き %1 要素は %3 属性を持ってはいけません。 %1 attribute of %2 element must be %3 or %4. - + %2 要素の %1 属性は %3 か %4 でなければなりません。 %1 attribute of %2 element must have a value of %3. - + %2 要素の %1 属性の値は %3 でなければなりません。 %1 attribute of %2 element must have a value of %3 or %4. - + %2 要素の %1 属性の値は %3 か %4 でなければなりません。 %1 element must not have %2 and %3 attribute together. - + %1 要素は %2 と %3 属性を同時に持っていてはいけません。 Content of %1 attribute of %2 element must not be from namespace %3. - + %2 要素の %1 属性のコンテンツは名前空間 %3 のものであってはいけません。 %1 attribute of %2 element must not be %3. - + %2 要素の %1 属性は %3 であってはいけません。 %1 attribute of %2 element must have the value %3 because the %4 attribute is set. - + %2 要素の %1 属性は %4 属性がセットされているので値 %3 を持たなければなりません。 Specifying use='prohibited' inside an attribute group has no effect. - + 属性グループ内で定義されている use = 'prohibited' は効果がありません。 %1 element must have either %2 or %3 attribute. - + %1 要素は %2 か %3 属性のどちらかを持たなければなりません。 %1 element must have either %2 attribute or %3 or %4 as child element. - + %1 要素は %2 属性や子要素として %3 や %4 のどちらも持っていてはいけません。 %1 element requires either %2 or %3 attribute. - + %1 要素は %2 か %3 属性を必要とします。 Text or entity references not allowed inside %1 element - + テキストまたはエンティティ参照は %1 要素内で許可されていません %1 attribute of %2 element must contain %3, %4 or a list of URIs. - + %2 要素の %1 属性は %3、%4 または URI のリストを含んでいなければなりません。 %1 element is not allowed in this context. - + %1 要素はこのコンテキストで許可されていません。 %1 attribute of %2 element has larger value than %3 attribute. - + %2 要素の %1 属性は %3 属性よりも大きな値になっています。 Prefix of qualified name %1 is not defined. - + 修飾名 %1 のプレフィックスが定義されていません。 %1 attribute of %2 element must either contain %3 or the other values. - + %2 要素の %1 属性は %3 や他の値を含んではいけません。 Component with ID %1 has been defined previously. - + ID %1 のコンポーネントは以前に定義されています。 Element %1 already defined. - + 要素 %1 はすでに定義されています。 Attribute %1 already defined. - + 属性 %1 はすでに定義されています。 Type %1 already defined. - + 型 %1 はすでに定義されています。 Attribute group %1 already defined. - + 属性グループ %1 はすでに定義されています。 Element group %1 already defined. - + 要素グループ %1 はすでに定義されています。 Notation %1 already defined. - + 表記法 %1 はすでに定義されています。 Identity constraint %1 already defined. - + ID制約 %1 はすでに定義されています。 Duplicated facets in simple type %1. - + 単純型 %1 内でファセットが重複しています。 %1 references unknown %2 or %3 element %4. - + %1 は未知の %2 か %3 要素 %4 を参照しています。 %1 references identity constraint %2 that is no %3 or %4 element. - + %1 は %3 でも %4 要素でもないID制約 %2 を参照しています。 %1 has a different number of fields from the identity constraint %2 that it references. - + %1 のフィールド数が、自身が参照しているID制約 %2 のフィールド数と異なっています。 Base type %1 of %2 element cannot be resolved. - + %2 要素の基底型 %1 を解決できませんでした。 Item type %1 of %2 element cannot be resolved. - + %2 要素のアイテム型 %1 を解決できませんでした。 Member type %1 of %2 element cannot be resolved. - + %2 要素のメンバー型 %1 を解決できませんでした。 Type %1 of %2 element cannot be resolved. - + %2 要素の型 %1 を解決できませんでした。 Base type %1 of complex type cannot be resolved. - + 複合型の基底型 %1 を解決できませんでした。 %1 cannot have complex base type that has a %2. - + %1 は %2 を持った複合基底型を持つ事はできません。 Content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type. - + 複合型 %1 のコンテンツモデルは %2 要素を含んでいますが非 empty 型を派生した拡張にする事はできません。 Complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model. - + 複合型 %1 は、%3 要素をコンテンツモデルに含んでいる %2 の拡張にする事はできません。 Type of %1 element must be a simple type, %2 is not. - + %1 要素の型は %2 ではなく単純型にしなくてはいけません。 Substitution group %1 of %2 element cannot be resolved. - + %2 要素の代替グループ %1 を解決できませんでした。 Substitution group %1 has circular definition. - + 代替グループ %1 が循環参照しています。 Duplicated element names %1 in %2 element. - + %2 要素内で要素名 %1 が重複しています。 Reference %1 of %2 element cannot be resolved. - + %2 要素の参照 %1 を解決できませんでした。 Circular group reference for %1. - + グループ参照 %1 が循環しています。 %1 element is not allowed in this scope - + %1 要素はこのスコープ内で許可されていません %1 element cannot have %2 attribute with value other than %3. - + %1 要素は %3 以外の値の %2 属性を持つ事はできません。 %1 element cannot have %2 attribute with value other than %3 or %4. - + %1 要素は %3 や %4 以外の値の %2 属性を持つ事はできません。 %1 or %2 attribute of reference %3 does not match with the attribute declaration %4. - + 参照 %3 の %1 や %2 属性は属性宣言 %4 にマッチしません。 Attribute group %1 has circular reference. - + 属性グループ %1 が循環参照しています。 %1 attribute in %2 must have %3 use like in base type %4. - + %2 の属性 %1 は基底型 %4 のように %3 を所有しなくてはいけません。 Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2. - + %1 の属性ワイルドカードは、基底型 %2 の属性ワイルドカードの制約として無効です。 %1 has attribute wildcard but its base type %2 has not. - + %1 はワイルドカードを使用した属性を所有していますが基底型 %2 は所有していません。 Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible. - + 型 %1 の属性ワイルドカードの union と基底型 %2 の属性ワイルドカードは表現可能ではありません。 Enumeration facet contains invalid content: {%1} is not a value of type %2. - + 列挙型ファセットが不正なコンテンツを含んでいます: {%1} は、型 %2 の値ではありません。 Namespace prefix of qualified name %1 is not defined. - + 修飾名 %1 の名前空間プレフィックスが定義されていません。 %1 element %2 is not a valid restriction of the %3 element it redefines: %4. - + %1 要素 %2 は %3 要素が再定義している制約として無効です: %4。 %1 is not valid according to %2. - + %2 によると %1 は妥当ではありません。 String content does not match the length facet. - + string コンテンツが length ファセットにマッチしません。 String content does not match the minLength facet. - + string コンテンツが minLength ファセットにマッチしません。 String content does not match the maxLength facet. - + string コンテンツが maxLength ファセットにマッチしません。 String content does not match pattern facet. - + string コンテンツがパターンファセットにマッチしません。 String content is not listed in the enumeration facet. - + string コンテンツが列挙型ファセット内の一覧にありません。 Signed integer content does not match the maxInclusive facet. - + signed integer コンテンツが maxInclusive ファセットにマッチしません。 Signed integer content does not match the maxExclusive facet. - + signed integer コンテンツが maxExclusive ファセットにマッチしません。 Signed integer content does not match the minInclusive facet. - + signed integer コンテンツが minInclusive ファセットにマッチしません。 Signed integer content does not match the minExclusive facet. - + signed integer コンテンツが minExclusive ファセットにマッチしません。 Signed integer content is not listed in the enumeration facet. - + signed integer コンテンツが列挙型ファセット内の一覧にありません。 Signed integer content does not match pattern facet. - + signed integer コンテンツがパターンファセットにマッチしません。 Signed integer content does not match in the totalDigits facet. - + signed integer コンテンツが totalDigits ファセットで指定される値の範囲にマッチしません。 Unsigned integer content does not match the maxInclusive facet. - + unsigned integer コンテンツが maxInclusive ファセットにマッチしません。 Unsigned integer content does not match the maxExclusive facet. - + unsigned integer コンテンツが maxExclusive ファセットにマッチしません。 Unsigned integer content does not match the minInclusive facet. - + unsigned integer コンテンツが minInclusive ファセットにマッチしません。 Unsigned integer content does not match the minExclusive facet. - + unsigned integer コンテンツが minExclusive ファセットにマッチしません。 Unsigned integer content is not listed in the enumeration facet. - + unsigned integer コンテンツが列挙型ファセット内の一覧にありません。 Unsigned integer content does not match pattern facet. - + unsigned integer コンテンツがパターンファセットにマッチしません。 Unsigned integer content does not match in the totalDigits facet. - + unsigned integer コンテンツが totalDigits ファセットで指定される値の範囲にマッチしません。 Double content does not match the maxInclusive facet. - + double コンテンツが maxInclusive ファセットにマッチしません。 Double content does not match the maxExclusive facet. - + double コンテンツが maxExclusive ファセットにマッチしません。 Double content does not match the minInclusive facet. - + double コンテンツが minInclusive ファセットにマッチしません。 Double content does not match the minExclusive facet. - + double コンテンツが minExclusive ファセットにマッチしません。 Double content is not listed in the enumeration facet. - + double コンテンツが列挙型ファセット内の一覧にありません。 Double content does not match pattern facet. - + double コンテンツがパターンファセットにマッチしません。 Decimal content does not match in the fractionDigits facet. - + decimal コンテンツが fractionDigits ファセットで指定される値の範囲にマッチしません。 Decimal content does not match in the totalDigits facet. - + decimal コンテンツが totalDigits ファセットで指定される値の範囲にマッチしません。 Date time content does not match the maxInclusive facet. - + date time コンテンツが maxInclusive ファセットにマッチしません。 Date time content does not match the maxExclusive facet. - + date time コンテンツが maxExclusive ファセットにマッチしません。 Date time content does not match the minInclusive facet. - + date time コンテンツが minInclusive ファセットにマッチしません。 Date time content does not match the minExclusive facet. - + date time コンテンツが minExclusive ファセットにマッチしません。 Date time content is not listed in the enumeration facet. - + date time コンテンツが列挙型ファセット内の一覧にありません。 Date time content does not match pattern facet. - + date time コンテンツがパターンファセットにマッチしません。 Duration content does not match the maxInclusive facet. - + duration コンテンツが maxInclusive ファセットにマッチしません。 Duration content does not match the maxExclusive facet. - + duration コンテンツが maxExclusive ファセットにマッチしません。 Duration content does not match the minInclusive facet. - + duration コンテンツが minInclusive ファセットにマッチしません。 Duration content does not match the minExclusive facet. - + duration コンテンツが minExclusive ファセットにマッチしません。 Duration content is not listed in the enumeration facet. - + duration コンテンツが列挙型ファセット内の一覧にありません。 Duration content does not match pattern facet. - + duration コンテンツがパターンファセットにマッチしません。 Boolean content does not match pattern facet. - + boolean コンテンツがパターンファセットにマッチしません。 Binary content does not match the length facet. - + binary コンテンツが length ファセットにマッチしません。 Binary content does not match the minLength facet. - + binary コンテンツが minLength ファセットにマッチしません。 Binary content does not match the maxLength facet. - + binary コンテンツが maxLength ファセットにマッチしません。 Binary content is not listed in the enumeration facet. - + binary コンテンツが列挙型ファセット内の一覧にありません。 Invalid QName content: %1. - + 無効な QName コンテンツ: %1。 QName content is not listed in the enumeration facet. - + QName コンテンツが列挙型ファセット内の一覧にありません。 QName content does not match pattern facet. - + QName コンテンツがパターンファセットにマッチしません。 Notation content is not listed in the enumeration facet. - + notation コンテンツが列挙型ファセット内の一覧にありません。 List content does not match length facet. - + list コンテンツが length ファセットにマッチしません。 List content does not match minLength facet. - + list コンテンツが minLength ファセットにマッチしません。 List content does not match maxLength facet. - + list コンテンツが maxLength ファセットにマッチしません。 List content is not listed in the enumeration facet. - + list コンテンツが列挙型ファセット内の一覧にありません。 List content does not match pattern facet. - + list コンテンツがパターンファセットにマッチしません。 Union content is not listed in the enumeration facet. - + union コンテンツが列挙型ファセット内の一覧にありません。 Union content does not match pattern facet. - + union コンテンツがパターンファセットにマッチしません。 Data of type %1 are not allowed to be empty. - + 型 %1 のデータは空にする事を許容されていません。 Element %1 is missing child element. - + 要素 %1 に子要素がありません。 There is one IDREF value with no corresponding ID: %1. - + ID %1 に対応するIDREFがありません。 Loaded schema file is invalid. - + 読み込まれているスキーマファイルは無効です。 %1 contains invalid data. - + %1 は無効なデータを含んでいます。 xsi:schemaLocation namespace %1 has already appeared earlier in the instance document. - + xsi:schemaLocation 名前空間 %1 はインスタンスドキュメントの前に既に現れています。 xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute. - + 先頭の namespace ではない要素または属性の後に xsi:noNamespaceSchemaLocation を使用できません。 No schema defined for validation. - + 妥当性検証の為のスキーマが定義されていません。 No definition for element %1 available. - + 要素 %1 は使用できるように定義されていません。 Specified type %1 is not known to the schema. - + 指定された型 %1 はスキーマで未知です。 Element %1 is not defined in this scope. - + 要素 %1 がこのスコープ内で定義されていません。 Declaration for element %1 does not exist. - + 要素 %1 の宣言が存在しません。 Element %1 contains invalid content. - + 要素 %1 は不正な内容を含んでいます。 Element %1 is declared as abstract. - + 要素 %1 は抽象型として宣言されています。 Element %1 is not nillable. - + 要素 %1 は null を許可していません。 Attribute %1 contains invalid data: %2 - + 属性 %1 は不正なデータを含んでいます: %2 Element contains content although it is nillable. - + 要素は null が許容されていますが内容を含んでいます。 Fixed value constraint not allowed if element is nillable. - + null が許容されている要素への固定値制約は許容されていません。 Specified type %1 is not validly substitutable with element type %2. - + 指定された型 %1 は有効に置換できる要素型 %2 ではありません。 Complex type %1 is not allowed to be abstract. - + 複合型 %1 を抽象化する事は許可されていません。 Element %1 contains not allowed attributes. - + 要素 %1 は属性を含む事を許可されていません。 Element %1 contains not allowed child element. - + 要素 %1 は子要素を含む事を許可されていません。 Content of element %1 does not match its type definition: %2. - + 要素 %1 の内容が自身の型の定義とマッチしていません: %2。 Content of element %1 does not match defined value constraint. - + 要素 %1 の内容が定義されている値制約にマッチしていません。 Element %1 contains not allowed child content. - + 要素 %1 は子の内容を含む事を許可されていません。 Element %1 contains not allowed text content. - + 要素 %1 はテキストを含む事を許可されていません。 Element %1 cannot contain other elements, as it has a fixed content. - + 要素 %1 は固定値を持った他の要素を含む事はできません。 Element %1 is missing required attribute %2. - + 要素 %1 に要求された属性 %2 がありません。 Attribute %1 does not match the attribute wildcard. - + 属性 %1 は属性ワイルドカードにマッチしていません。 Declaration for attribute %1 does not exist. - + 属性 %1 の宣言が存在していません。 Element %1 contains two attributes of type %2. - + 要素 %1 が型 %2 の属性を2個含んでいます。 Attribute %1 contains invalid content. - + 属性 %1 は不正な内容を含んでいます。 Element %1 contains unknown attribute %2. - + 要素 %1 は未知の属性 %2 を含んでいます。 Content of attribute %1 does not match its type definition: %2. - + 属性 %1 の内容が自身の型の定義にマッチしていません: %2。 Content of attribute %1 does not match defined value constraint. - + 属性 %1 の内容が値制約の定義にマッチしていません。 Non-unique value found for constraint %1. - + 制約 %1 に一意ではない値が見つかりました。 Key constraint %1 contains absent fields. - + キー制約 %1 は欠落したフィールドを含んでいます。 Key constraint %1 contains references nillable element %2. - + キー制約 %1 は null を許容する要素 %2 の参照を含んでいます。 No referenced value found for key reference %1. - + キー参照 %1 によって参照される値が見つかりません。 More than one value found for field %1. - + フィールド %1 に2個以上の値があります。 Field %1 has no simple type. - + フィールド %1 が単純型を持っていません。 ID value '%1' is not unique. - + ID 値 '%1' が一意ではありません。 '%1' attribute contains invalid QName content: %2. - + '%1' 属性は不正な QName の内容を含んでいます: %2。 empty diff --git a/translations/qtconfig_ja.ts b/translations/qtconfig_ja.ts index e92a7d1..2c3c248 100644 --- a/translations/qtconfig_ja.ts +++ b/translations/qtconfig_ja.ts @@ -4,151 +4,114 @@ MainWindow - Desktop Settings (Default) デスクトップの設定(デフォルト) - Choose style and palette based on your desktop settings. デスクトップの設定に応じてスタイルとパレットを選択します。 - On The Spot On The Spot - - - - Auto (default) 自動(デフォルト) - Choose audio output automatically. オーディオ出力を自動的に選択します。 - - aRts aRts - Experimental aRts support for GStreamer. Gstreamer での aRts のサポート(Experimental)。 - Phonon GStreamer backend not available. Phonon の GStreamer バックエンドが見つかりません。 - Choose render method automatically 描画メソッドを自動的に選択します - - X11 X11 - Use X11 Overlays X11 のオーバーレイを使用 - - OpenGL OpenGL - Use OpenGL if available OpenGL が使用可能な場合は使用 - - Software ソフトウェア - Use simple software rendering ソフトウェアでの描画を使用 - No changes to be saved. 内容が変更されていません。 - Saving changes... 保存中… - Over The Spot Over The Spot - Off The Spot Off The Spot - Root Root - Select a Directory ディレクトリの選択 - <h3>%1</h3><br/>Version %2<br/><br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). <h3>%1</h3><br/>バージョン %2<br/><br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). - - - Qt Configuration Qt 設定ツール - Save Changes 変更の保存 - Save changes to settings? 変更内容を設定に保存しますか? - &Yes はい(&Y) - &No いいえ(&N) - &Cancel キャンセル(&C) @@ -156,363 +119,278 @@ MainWindowBase - Qt Configuration Qt 設定ツール - Appearance 外観 - GUI Style GUI スタイル - Select GUI &Style: GUI スタイルの選択(&S): - Preview プレビュー - Select &Palette: パレットの選択(&P): - Active Palette アクティブなパレット - Inactive Palette アクティブではないパレット - Disabled Palette 無効時のパレット - Build Palette パレットの設定 - &3-D Effects: &3D エフェクト: - Window Back&ground: ウィンドウのバックグラウンド(&G): - &Tune Palette... パレットを調整(&T)... - Please use the KDE Control Center to set the palette. KDE のコントロールセンターでパレットの設定をしてください。 - Fonts フォント - Default Font デフォルトのフォント - &Style: スタイル(&S): - &Point Size: ポイントサイズ(&P): - F&amily: ファミリー(&F): - Sample Text テキストのサンプル - Font Substitution フォントの置換 - S&elect or Enter a Family: ファミリーを選択するか入力してください(&E): - Current Substitutions: 現在の置換定義: - - Up 上へ - - Down 下へ - - Remove 削除 - Select s&ubstitute Family: 置換するファミリーの選択(&U): - - Add 追加 - Interface インターフェース - Feel Settings 一般的な設定 - - ms ミリ秒 - &Double Click Interval: ダブルクリックの間隔(&D): - No blinking 点滅しない - &Cursor Flash Time: カーソルの点滅の間隔(&C): - lines - Wheel &Scroll Lines: マウスホイールでのスクロール行数(&S): - Resolve symlinks in URLs URL のシンボリックリンクの解決 - GUI Effects GUI のエフェクト - &Enable 有効(&E) - Alt+E Alt+E - &Menu Effect: メニューのエフェクト(&E): - C&omboBox Effect: コンボボックスのエフェクト(&O): - &ToolTip Effect: ツールチップのエフェクト(&T): - Tool&Box Effect: ツールボックスのエフェクト(&B): - - - - Disable 無効 - - - - Animate アニメーション - - Fade フェード - Global Strut Global Strut - Minimum &Width: 幅の最小値(&W): - Minimum Hei&ght: 高さの最小値(&G): - - pixels ピクセル - Enhanced support for languages written right-to-left 右から左に書かれる言語のサポートの強化 - XIM Input Style: XIM のインプットスタイル: - On The Spot On The Spot - Over The Spot Over The Spot - Off The Spot Off The Spot - Root Root - Default Input Method: デフォルトのインプットメソッド: - Printer プリンタ - Enable Font embedding フォントを埋め込む - Font Paths フォントのパス - Browse... ブラウズ... - Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. <b>ブラウズ</b>ボタンを押すかディレクトリを入力し、エンターキーか追加ボタンでリストに追加してください。 - Phonon Phonon - About Phonon Phonon について - - Current Version: 現在のバージョン: - - Not available 使用不可能 - - Website: ウェブサイト: - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -525,12 +403,10 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html> - About GStreamer GStreamer について - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -543,22 +419,18 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html> - GStreamer backend settings GStreamer のバックエンドの設定 - Preferred audio sink: 優先するオーディオシンク: - Preferred render method: 優先する描画方法: - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -571,57 +443,46 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">注: これらの設定の変更によりアプリケーションが正常に起動しなくなる場合があります。</span></p></body></html> - &File ファイル(&F) - &Help ヘルプ(&H) - &Save 保存(&S) - Save 保存 - Ctrl+S Ctrl+S - E&xit 終了(&X) - Exit 終了 - &About Qt 設定ツールについて(&A) - About Qt 設定ツールについて - About &Qt &Qt について - About Qt Qt について @@ -629,208 +490,166 @@ p, li { white-space: pre-wrap; } PaletteEditorAdvancedBase - Tune Palette パレットの調整 - <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> <b>パレットの編集</b><p>現在のウィジェットやフォームのパレットを変更してください。</p><p>自動生成されたパレットを使用するか、それぞれのグループ/役割に対して色を選択してください。</p><p>パレットの内容のプレビューセクションにある様々なウィジェットのレイアウトで確認できます。</p> - Select &Palette: パレットの選択(&P): - Active Palette アクティブなパレット - Inactive Palette アクティブではないパレット - Disabled Palette 無効時のパレット - Auto 自動 - Build inactive palette from active アクティブなパレットからアクティブではないパレットを構築 - Build disabled palette from active アクティブなパレットから無効時のパレットを構築 - Central color &roles 中央部の色の役割(&R) - Choose central color role 中央部の色の役割を選択してください - <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p> <b>色の役割の選択。</b><p>選択可能な中央部の役割: <ul> <li>ウィンドウ - 一般的な背景色。</li> <li>ウィンドウテキスト - 一般的な前景色。 </li> <li>ベース - テキスト入力ウィジェット等の背景色。通常は白などの明るい色。 </li> <li>テキスト - ベースと共に用いられる前景色。通常はウィンドウテキストと同じだが、ウィンドウとベースに対してよりよいコントラストが必要な場合に使用される。 </li> <li>ボタン - 一般的なボタンの背景色。Macintosh スタイルのようにウィンドウと異なる背景色を使用する場合に使用される。 </li> <li>ボタンテキスト - ボタンと共に用いられる前景色 </li> <li>ハイライト - アイテムが選択されていたり、ハイライトされていることを示すために使用される色。 </li> <li>ハイライトのテキスト - ハイライト時のテキストの色。 </li> <li>明るいテキスト - 黒などの背景色に対して使用されるテキストの色。ウィンドウテキストの反対の色。 </li> </ul> </p> - Window ウィンドウ - WindowText ウィンドウテキスト - Button ボタン - Base ベース - Text テキスト - BrightText 明るいテキスト - ButtonText ボタンテキスト - Highlight ハイライト - HighlightedText ハイライトのテキスト - &Select Color: 色の選択(&S): - - Choose a color 色を選択してください - Choose a color for the selected central color role. 選択された中央部の色の役割に使用する色を選択してください。 - 3-D shadow &effects 3Dの影の効果(&E) - Build &from button color ボタンの色から構築する(&F) - Generate shadings 影を生成する - Check to let 3D-effect colors be calculated from button-color. 3D効果の色をボタンの色から計算するにはチェックしてください。 - Choose 3D-effect color role 3D効果の色の役割の選択 - <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> <b>色の役割の選択。</b><p>選択可能な中央部の役割: <ul> <li>ライト - ボタンの色より明るい。 </li> <li>ミッドライト - ボタンとライトの間。 </li> <li>ミッド - ボタンとダークの間。 </li> <li>ダーク - ボタンより暗い。 </li> <li>シャドウ - とても暗い色。 </li> </ul> - Light ライト - Midlight ミッドライト - Mid ミッド - Dark ダーク - Shadow シャドウ - Select Co&lor: 色の選択(&L): - Choose a color for the selected effect color role. 選択の効果の色の役割に使用する色を選択してください。 - OK OK - Close dialog and apply all changes. 全ての変更を適用してダイアログを閉じる。 - Cancel キャンセル - Close dialog and discard all changes. 全ての変更を破棄してダイアログを閉じる。 @@ -838,7 +657,6 @@ p, li { white-space: pre-wrap; } PreviewFrame - Desktop settings will only take effect after an application restart. デスクトップの設定はアプリケーションの再起動後に反映されます。 @@ -846,62 +664,50 @@ p, li { white-space: pre-wrap; } PreviewWidgetBase - Preview Window プレビューウィンドウ - ButtonGroup ボタングループ - RadioButton1 ラジオボタン1 - RadioButton2 ラジオボタン2 - RadioButton3 ラジオボタン3 - ButtonGroup2 ボタングループ2 - CheckBox1 チェックボックス1 - CheckBox2 チェックボックス2 - LineEdit ラインエディタ - ComboBox コンボボックス - PushButton プッシュボタン - <p> <a href="http://qt.nokia.com">http://qt.nokia.com</a> </p> diff --git a/translations/qvfb_ja.ts b/translations/qvfb_ja.ts index cdf95c1..5dcfbc4 100644 --- a/translations/qvfb_ja.ts +++ b/translations/qvfb_ja.ts @@ -4,71 +4,54 @@ AnimationSaveWidget - - Record 録画 - Reset リセット - Save 保存 - Save in MPEG format (requires netpbm package installed) MPEG形式で保存(netpbmパッケージのインストールが必要) - - Click record to begin recording. 録画を開始するには「録画」をクリックしてください。 - - Finished saving. 保存が完了しました。 - Paused. Click record to resume, or save if done. 一時停止中。「録画」をクリック再開するか、保存をしてください。 - Pause 一時停止 - Recording... 録画中... - Saving... 保存中... - - Save animation... 動画を保存中... - Save canceled. 保存がキャンセルされました。 - Save failed! 保存に失敗しました! @@ -76,195 +59,154 @@ Config - Configure 設定 - Size サイズ - 176x220 "SmartPhone" 176x220 "スマートフォン" - 240x320 "PDA" 240x320 "PDA" - 320x240 "TV" / "QVGA" 320x240 "TV" / "QVGA" - 640x480 "VGA" 640x480 "VGA" - 800x480 800x480 - 800x600 800x600 - 1024x768 1024x768 - Custom それ以外 - Depth 色深度 - 1 bit monochrome 1 bit モノクロ - 2 bit grayscale 2 bit グレイスケール - 4 bit grayscale 4 bit グレイスケール - 8 bit 8 bit - 12 (16) bit 12(16) bit - 15 bit 15 bit - 16 bit 16 bit - 18 bit 18 bit - 24 bit 24 bit - 32 bit 32 bit - 32 bit ARGB 32 bit ARGB - Swap red and blue channels 赤と青のチャンネルを入れ替える - BGR format BGR フォーマット - Skin スキン - None なし - Emulate touch screen (no mouse move) タッチスクリーンのエミュレート(マウスムーブが無効になります) - Emulate LCD screen (Only with fixed zoom of 3.0 times magnification) LCDスクリーンのエミュレート(3倍固定の拡大ズーム) - <p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>. <p><i>以上の</i>サイズや色深度を変更した場合、ヴァーチャルフレームバッファ上で動作しているアプリケーションは終了します。<i>以下の</i>ガンマ値の変更の場合はアプリケーションは終了しません。 - Gamma ガンマ - Blue - - - - 1.0 1.0 - Green - All 全て - Red - Set all to 1.0 全て1.0にする - &OK &OK - &Cancel キャンセル(&C) @@ -272,57 +214,46 @@ DeviceSkin - The image file '%1' could not be loaded. 画像ファイル "%1" を読み込めません。 - The skin directory '%1' does not contain a configuration file. スキンのディレクトリ "%1" に設定ファイルがありません。 - The skin configuration file '%1' could not be opened. スキンの設定ファイル "%1" が開けません。 - The skin configuration file '%1' could not be read: %2 スキンの設定ファイル "%1" が読み込めません: %2 - Syntax error: %1 シンタックスエラー: %1 - The skin "up" image file '%1' does not exist. スキンの "up" の画像ファイル "%1" がありません。 - The skin "down" image file '%1' does not exist. スキンの "down" の画像ファイル "%1" がありません。 - The skin "closed" image file '%1' does not exist. スキンの "closed" の画像ファイル "%1" がありません。 - The skin cursor image file '%1' does not exist. スキンのカーソルの画像ファイル "%1" がありません。 - Syntax error in area definition: %1 エリア定義のシンタックスエラー: %1 - Mismatch in number of areas, expected %1, got %2. エリア数が正しくありません。%2 となってありますが %1 であるべきです。 @@ -330,170 +261,134 @@ QVFb - &Save image... 画像の保存(&S)... - &Animation... 動画の保存(&A)... - &Quit 終了(&Q) - Show &Cursor カーソルの表示(&C) - &Refresh Rate... リフレッシュレート(&R)... - Zoom scale &0.5 ズームスケール &0.5 - Zoom scale &1 ズームスケール &1 - Zoom scale &2 ズームスケール &2 - Zoom scale &3 ズームスケール &3 - Zoom scale &4 ズームスケール &4 - &File ファイル(&F) - &Configure... 設定の変更(&C)... - &View 表示(&V) - &No rotation ローテーションなし(&N) - &90° rotation &90° ローテーション - 1&80° rotation 1&80° ローテーション - 2&70° rotation 2&70° ローテーション - Zoom scale 0.7&5 ズームスケール 0.7&5 - Zoom &scale... ズームスケール(&S)... - &Help ヘルプ(&H) - &About... QVFB について(&A)... - Save Main Screen image メインスクリーンの画像の保存 - - snapshot.png スナップショット.png - - Portable Network Graphics (*.png) - Save Main Screen Image メインスクリーンの画像の保存 - - Save failed. Check that you have permission to write to the target directory. 保存に失敗しました。保存先のディレクトリn書き込み権限があるかを確認してください。 - Save Second Screen image サブスクリーンの画像の保存 - Save Second Screen Image サブスクリーンの画像の保存 - About QVFB QVFB について - <h2>The Qt for Embedded Linux Virtual X11 Framebuffer</h2><p>This application runs under Qt for X11, emulating a simple framebuffer, which the Qt for Embedded Linux server and clients can attach to just as if it was a hardware Linux framebuffer. <p>With the aid of this development tool, you can develop Qt for Embedded Linux applications under X11 without having to switch to a virtual console. This means you can comfortably use your other development tools such as GUI profilers and debuggers. <h2>The Qt for Embedded Linux Virtual X11 Framebuffer</h2><p>このアプリケーションは Qt for X11 上で動作し、Qt for Embedded Linux のサーバーとクライアントがハードウェアの Linux フレームバッファのように接続可能なシンプルなフレームバッファをエミュレートします。 <p>この開発ツールを使用すると Qt for Embedded Linux 向けのアプリケーションが X11 上でヴァーチャルコンソールへ切り替える事なく開発できるようになります。GUI のプロファイラやデバッガなどの他のツールを一緒に使用する時に便利でしょう。 - Browse... 他のスキンを参照... - Load Custom Skin... カスタムスキンを開く... - All QVFB Skins (*.skin) QVFB のスキン(*.skin) @@ -501,23 +396,18 @@ QVFbRateDialog - Target frame rate: ターゲットのフレームレート: - - %1fps %1fps - OK OK - Cancel キャンセル -- cgit v0.12 From 25ddfb434f13aa3bbc6ac303aa17dbe9582bf3f0 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 4 Oct 2010 15:42:51 +0300 Subject: Revert "When using complex transformations rendering goes easily off by one pixel." This reverts commit 2acdc634ee895af4a9738c0f6c2496e388afba38. Originally this fixed QT-3791 but it caused lots of problems in other sites. So reverting this will fix QT-4001 but reopens QT-3791. QT-4001 blocks Qt 4.7.1 but QT-3791 doesn't. Task-number: QT-4001 Reviewed-by: Jason Barron --- src/openvg/qpaintengine_vg.cpp | 158 +++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 92 deletions(-) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 74395a2..f6d2435 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -196,9 +196,7 @@ public: #endif QTransform transform; // Currently active transform. - bool affineTransform; // True if the transform is non-projective. - bool simpleTransform; // True if the transform is simple translate - // or 0, 90, 180, and 270 degree rotation + bool simpleTransform; // True if the transform is simple (non-projective). qreal penScale; // Pen scaling factor from "transform". QTransform pathTransform; // Calculated VG path transformation. @@ -379,7 +377,6 @@ void QVGPaintEnginePrivate::init() roundRectPath = 0; #endif - affineTransform = true; simpleTransform = true; pathTransformSet = false; penScale = 1.0; @@ -532,59 +529,12 @@ void QVGPaintEnginePrivate::setTransform vgLoadMatrix(mat); } -// Determine if a co-ordinate transform is simple enough to allow -// rectangle-based clipping with vgMask() and rounding translation -// to integers. Simple transforms most often result from origin translations. -static inline bool transformIsSimple(const QTransform& transform) -{ - QTransform::TransformationType type = transform.type(); - if (type == QTransform::TxNone || type == QTransform::TxTranslate) { - return true; - } else if (type == QTransform::TxScale) { - // Check for 0 and 180 degree rotations. - // (0 might happen after 4 rotations of 90 degrees). - qreal m11 = transform.m11(); - qreal m12 = transform.m12(); - qreal m21 = transform.m21(); - qreal m22 = transform.m22(); - if (m12 == 0.0f && m21 == 0.0f) { - if (m11 == 1.0f && m22 == 1.0f) - return true; // 0 degrees - else if (m11 == -1.0f && m22 == -1.0f) - return true; // 180 degrees. - if(m11 == 1.0f && m22 == -1.0f) - return true; // 0 degrees inverted y. - else if(m11 == -1.0f && m22 == 1.0f) - return true; // 180 degrees inverted y. - } - } else if (type == QTransform::TxRotate) { - // Check for 90, and 270 degree rotations. - qreal m11 = transform.m11(); - qreal m12 = transform.m12(); - qreal m21 = transform.m21(); - qreal m22 = transform.m22(); - if (m11 == 0.0f && m22 == 0.0f) { - if (m12 == 1.0f && m21 == -1.0f) - return true; // 90 degrees. - else if (m12 == -1.0f && m21 == 1.0f) - return true; // 270 degrees. - else if (m12 == -1.0f && m21 == -1.0f) - return true; // 90 degrees inverted y. - else if (m12 == 1.0f && m21 == 1.0f) - return true; // 270 degrees inverted y. - } - } - return false; -} - Q_DECL_IMPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) { VGfloat devh = pdev->height(); - simpleTransform = transformIsSimple(transform); - // Construct the VG transform by combining the Qt transform with // the following viewport transformation: // | 1 0 0 | @@ -607,9 +557,9 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) // so we will have to convert the co-ordinates ourselves. // Change the matrix to just the viewport transformation. pathTransform = viewport; - affineTransform = false; + simpleTransform = false; } else { - affineTransform = true; + simpleTransform = true; } pathTransformSet = false; @@ -638,7 +588,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) // Size is sufficient segments for drawRoundedRect() paths. QVarLengthArray segments; - if (sizeof(qreal) == sizeof(VGfloat) && elements && affineTransform) { + if (sizeof(qreal) == sizeof(VGfloat) && elements && simpleTransform) { // If Qt was compiled with qreal the same size as VGfloat, // then convert the segment types and use the incoming // points array directly. @@ -673,7 +623,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) int curvePos = 0; QPointF temp; - if (elements && affineTransform) { + if (elements && simpleTransform) { // Convert the members of the element array. for (int i = 0; i < count; ++i) { switch (elements[i]) { @@ -717,7 +667,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) } points += 2; } - } else if (elements && !affineTransform) { + } else if (elements && !simpleTransform) { // Convert the members of the element array after applying the // current transform to the path locally. for (int i = 0; i < count; ++i) { @@ -766,7 +716,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) } points += 2; } - } else if (count > 0 && affineTransform) { + } else if (count > 0 && simpleTransform) { // If there is no element array, then the path is assumed // to be a MoveTo followed by several LineTo's. coords.append(points[0]); @@ -779,7 +729,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) segments.append(VG_LINE_TO_ABS); --count; } - } else if (count > 0 && !affineTransform) { + } else if (count > 0 && !simpleTransform) { // Convert a simple path, and apply the transform locally. temp = transform.map(QPointF(points[0], points[1])); coords.append(temp.x()); @@ -840,7 +790,7 @@ VGPath QVGPaintEnginePrivate::painterPathToVGPath(const QPainterPath& path) bool haveStart = false; bool haveEnd = false; - if (affineTransform) { + if (simpleTransform) { // Convert the members of the element array. for (int i = 0; i < count; ++i) { switch (elements[i].type) { @@ -1615,6 +1565,36 @@ void QVGPaintEngine::stroke(const QVectorPath &path, const QPen &pen) vgDestroyPath(vgpath); } +// Determine if a co-ordinate transform is simple enough to allow +// rectangle-based clipping with vgMask(). Simple transforms most +// often result from origin translations. +static inline bool clipTransformIsSimple(const QTransform& transform) +{ + QTransform::TransformationType type = transform.type(); + if (type == QTransform::TxNone || type == QTransform::TxTranslate) + return true; + if (type == QTransform::TxRotate) { + // Check for 0, 90, 180, and 270 degree rotations. + // (0 might happen after 4 rotations of 90 degrees). + qreal m11 = transform.m11(); + qreal m12 = transform.m12(); + qreal m21 = transform.m21(); + qreal m22 = transform.m22(); + if (m11 == 0.0f && m22 == 0.0f) { + if (m12 == 1.0f && m21 == -1.0f) + return true; // 90 degrees. + else if (m12 == -1.0f && m21 == 1.0f) + return true; // 270 degrees. + } else if (m12 == 0.0f && m21 == 0.0f) { + if (m11 == -1.0f && m22 == -1.0f) + return true; // 180 degrees. + else if (m11 == 1.0f && m22 == 1.0f) + return true; // 0 degrees. + } + } + return false; +} + #if defined(QVG_SCISSOR_CLIP) void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) @@ -1632,7 +1612,7 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) // We aren't using masking, so handle simple QRectF's only. if (path.shape() == QVectorPath::RectangleHint && - path.elementCount() == 4 && d->simpleTransform) { + path.elementCount() == 4 && clipTransformIsSimple(d->transform)) { // Clipping region that resulted from QPainter::setClipRect(QRectF). // Convert it into a QRect and apply. const qreal *points = path.points(); @@ -1782,7 +1762,7 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) // We don't have vgRenderToMask(), so handle simple QRectF's only. if (path.shape() == QVectorPath::RectangleHint && - path.elementCount() == 4 && d->simpleTransform) { + path.elementCount() == 4 && clipTransformIsSimple(d->transform)) { // Clipping region that resulted from QPainter::setClipRect(QRectF). // Convert it into a QRect and apply. const qreal *points = path.points(); @@ -1834,7 +1814,7 @@ void QVGPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) d->dirty |= QPaintEngine::DirtyClipRegion; // If we have a non-simple transform, then use path-based clipping. - if (op != Qt::NoClip && !d->simpleTransform) { + if (op != Qt::NoClip && !clipTransformIsSimple(d->transform)) { QPaintEngineEx::clip(rect, op); return; } @@ -1953,7 +1933,7 @@ void QVGPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op) d->dirty |= QPaintEngine::DirtyClipRegion; // If we have a non-simple transform, then use path-based clipping. - if (op != Qt::NoClip && !d->simpleTransform) { + if (op != Qt::NoClip && !clipTransformIsSimple(d->transform)) { QPaintEngineEx::clip(region, op); return; } @@ -2530,14 +2510,14 @@ void QVGPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) // Check to see if we can use vgClear() for faster filling. if (brush.style() == Qt::SolidPattern && brush.isOpaque() && - d->simpleTransform && d->opacity == 1.0f && + clipTransformIsSimple(d->transform) && d->opacity == 1.0f && clearRect(rect, brush.color())) { return; } #if !defined(QVG_NO_MODIFY_PATH) VGfloat coords[8]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = rect.x(); coords[1] = rect.y(); coords[2] = rect.x() + rect.width(); @@ -2572,14 +2552,14 @@ void QVGPaintEngine::fillRect(const QRectF &rect, const QColor &color) Q_D(QVGPaintEngine); // Check to see if we can use vgClear() for faster filling. - if (d->simpleTransform && d->opacity == 1.0f && color.alpha() == 255 && + if (clipTransformIsSimple(d->transform) && d->opacity == 1.0f && color.alpha() == 255 && clearRect(rect, color)) { return; } #if !defined(QVG_NO_MODIFY_PATH) VGfloat coords[8]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = rect.x(); coords[1] = rect.y(); coords[2] = rect.x() + rect.width(); @@ -2612,7 +2592,7 @@ void QVGPaintEngine::fillRect(const QRectF &rect, const QColor &color) void QVGPaintEngine::drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode) { Q_D(QVGPaintEngine); - if (d->affineTransform) { + if (d->simpleTransform) { QVGPainterState *s = state(); VGPath vgpath = d->roundedRectPath(rect, xrad, yrad, mode); d->draw(vgpath, s->pen, s->brush); @@ -2631,7 +2611,7 @@ void QVGPaintEngine::drawRects(const QRect *rects, int rectCount) QVGPainterState *s = state(); for (int i = 0; i < rectCount; ++i, ++rects) { VGfloat coords[8]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = rects->x(); coords[1] = rects->y(); coords[2] = rects->x() + rects->width(); @@ -2672,7 +2652,7 @@ void QVGPaintEngine::drawRects(const QRectF *rects, int rectCount) QVGPainterState *s = state(); for (int i = 0; i < rectCount; ++i, ++rects) { VGfloat coords[8]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = rects->x(); coords[1] = rects->y(); coords[2] = rects->x() + rects->width(); @@ -2710,7 +2690,7 @@ void QVGPaintEngine::drawLines(const QLine *lines, int lineCount) QVGPainterState *s = state(); for (int i = 0; i < lineCount; ++i, ++lines) { VGfloat coords[4]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = lines->x1(); coords[1] = lines->y1(); coords[2] = lines->x2(); @@ -2738,7 +2718,7 @@ void QVGPaintEngine::drawLines(const QLineF *lines, int lineCount) QVGPainterState *s = state(); for (int i = 0; i < lineCount; ++i, ++lines) { VGfloat coords[4]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = lines->x1(); coords[1] = lines->y1(); coords[2] = lines->x2(); @@ -2764,7 +2744,7 @@ void QVGPaintEngine::drawEllipse(const QRectF &r) // Based on the description of vguEllipse() in the OpenVG specification. // We don't use vguEllipse(), to avoid unnecessary library dependencies. Q_D(QVGPaintEngine); - if (d->affineTransform) { + if (d->simpleTransform) { QVGPainterState *s = state(); VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, @@ -2837,7 +2817,7 @@ void QVGPaintEngine::drawPoints(const QPointF *points, int pointCount) for (int i = 0; i < pointCount; ++i, ++points) { VGfloat coords[4]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = points->x(); coords[1] = points->y(); coords[2] = coords[0]; @@ -2871,7 +2851,7 @@ void QVGPaintEngine::drawPoints(const QPoint *points, int pointCount) for (int i = 0; i < pointCount; ++i, ++points) { VGfloat coords[4]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = points->x(); coords[1] = points->y(); coords[2] = coords[0]; @@ -2905,7 +2885,7 @@ void QVGPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonD QVarLengthArray coords; QVarLengthArray segments; for (int i = 0; i < pointCount; ++i, ++points) { - if (d->affineTransform) { + if (d->simpleTransform) { coords.append(points->x()); coords.append(points->y()); } else { @@ -2952,7 +2932,7 @@ void QVGPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDr QVarLengthArray coords; QVarLengthArray segments; for (int i = 0; i < pointCount; ++i, ++points) { - if (d->affineTransform) { + if (d->simpleTransform) { coords.append(points->x()); coords.append(points->y()); } else { @@ -2987,7 +2967,7 @@ void QVGPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDr void QVGPaintEnginePrivate::setImageOptions() { - if (opacity != 1.0f && affineTransform) { + if (opacity != 1.0f && simpleTransform) { if (opacity != paintOpacity) { VGfloat values[4]; values[0] = 1.0f; @@ -3034,10 +3014,7 @@ static void drawVGImage(QVGPaintEnginePrivate *d, QTransform transform(d->imageTransform); VGfloat scaleX = sr.width() == 0.0f ? 0.0f : r.width() / sr.width(); VGfloat scaleY = sr.height() == 0.0f ? 0.0f : r.height() / sr.height(); - if (d->simpleTransform) - transform.translate(qRound(r.x()), qRound(r.y())); - else - transform.translate(r.x(), r.y()); + transform.translate(r.x(), r.y()); transform.scale(scaleX, scaleY); d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform); @@ -3055,10 +3032,7 @@ static void drawVGImage(QVGPaintEnginePrivate *d, return; QTransform transform(d->imageTransform); - if(d->simpleTransform) - transform.translate(qRound(pos.x()), qRound(pos.y())); - else - transform.translate(pos.x(), pos.y()); + transform.translate(pos.x(), pos.y()); d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform); d->setImageOptions(); @@ -3101,7 +3075,7 @@ void QVGPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF QVGPixmapData *vgpd = static_cast(pd); if (!vgpd->isValid()) return; - if (d->affineTransform) + if (d->simpleTransform) drawVGImage(d, r, vgpd->toVGImage(), vgpd->size(), sr); else drawVGImage(d, r, vgpd->toVGImage(d->opacity), vgpd->size(), sr); @@ -3120,7 +3094,7 @@ void QVGPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm) QVGPixmapData *vgpd = static_cast(pd); if (!vgpd->isValid()) return; - if (d->affineTransform) + if (d->simpleTransform) drawVGImage(d, pos, vgpd->toVGImage()); else drawVGImage(d, pos, vgpd->toVGImage(d->opacity)); @@ -3135,7 +3109,7 @@ void QVGPaintEngine::drawImage { Q_D(QVGPaintEngine); VGImage vgImg; - if (d->affineTransform || d->opacity == 1.0f) + if (d->simpleTransform || d->opacity == 1.0f) vgImg = toVGImageSubRect(image, sr.toRect(), flags); else vgImg = toVGImageWithOpacitySubRect(image, d->opacity, sr.toRect()); @@ -3158,7 +3132,7 @@ void QVGPaintEngine::drawImage(const QPointF &pos, const QImage &image) { Q_D(QVGPaintEngine); VGImage vgImg; - if (d->affineTransform || d->opacity == 1.0f) + if (d->simpleTransform || d->opacity == 1.0f) vgImg = toVGImage(image); else vgImg = toVGImageWithOpacity(image, d->opacity); @@ -3191,7 +3165,7 @@ void QVGPaintEngine::drawPixmapFragments(const QPainter::PixmapFragment *drawing QPixmapData *pd = pixmap.pixmapData(); if (!pd) return; // null QPixmap - if (pd->classId() != QPixmapData::OpenVGClass || !d->affineTransform) { + if (pd->classId() != QPixmapData::OpenVGClass || !d->simpleTransform) { QPaintEngineEx::drawPixmapFragments(drawingData, dataCount, pixmap, hints); return; } @@ -3416,7 +3390,7 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) // If we are not using a simple transform, then fall back // to the default Qt path stroking algorithm. - if (!d->affineTransform) { + if (!d->simpleTransform) { QPaintEngineEx::drawTextItem(p, textItem); return; } -- cgit v0.12 From 2ab99337faa0ec03721fb39cae52361f7ac4d780 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 4 Oct 2010 22:34:49 +0300 Subject: Fix gcc compilation problems in QtOpenGL. Actually was typo and for some reason rvct didn't catch that. Reviewed-by: TRUSTME --- src/opengl/gl2paintengineex/qtriangulator.cpp | 4 ++-- tests/auto/qglthreads/tst_qglthreads.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index ea072b4..bf21240 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -2025,7 +2025,7 @@ void QTriangulator::ComplexToSimple::fillPriorityQueue() Q_ASSERT(m_edges.at(i).previous == -1 && m_edges.at(i).next == -1); Q_ASSERT(m_edges.at(i).node == 0); Q_ASSERT(m_edges.at(i).pointingUp == m_edges.at(i).originallyPointingUp); - Q_ASSERT(m_edges.at(i).pointingUp == (m_parent->m_vertices.at(qint32)(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from))); + Q_ASSERT(m_edges.at(i).pointingUp == (m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from))); // Ignore zero-length edges. if (m_parent->m_vertices.at(m_edges.at(i).to) != m_parent->m_vertices.at(m_edges.at(i).from)) { QPodPoint upper = m_parent->m_vertices.at(m_edges.at(i).upper()); @@ -2214,7 +2214,7 @@ void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() while (current != b.second) { Q_ASSERT(current); Q_ASSERT(m_edges.at(current->data).node == current); - Q_ASSERT(qIntersectionPoint(event.point).isOnLine(m_parent->m_vertices.at(m_edges.at(current->data).from), m_parent->m_vertices.at(qint32)(m_edges.at(current->data).to))); + Q_ASSERT(qIntersectionPoint(event.point).isOnLine(m_parent->m_vertices.at(m_edges.at(current->data).from), m_parent->m_vertices.at(m_edges.at(current->data).to))); Q_ASSERT(m_parent->m_vertices.at(m_edges.at(current->data).from) == event.point || m_parent->m_vertices.at(m_edges.at(current->data).to) == event.point); insertEdgeIntoVectorIfWanted(orderedEdges, current->data); current = m_edgeList.next(current); diff --git a/tests/auto/qglthreads/tst_qglthreads.cpp b/tests/auto/qglthreads/tst_qglthreads.cpp index cce3161..06131bd 100644 --- a/tests/auto/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/qglthreads/tst_qglthreads.cpp @@ -49,6 +49,10 @@ #include #endif +#ifdef Q_OS_SYMBIAN +#include // for usleep +#endif + #define RUNNING_TIME 5000 tst_QGLThreads::tst_QGLThreads(QObject *parent) @@ -209,6 +213,7 @@ public: p.drawText(image.rect(), Qt::AlignCenter, "This is an autotest"); p.end(); m_gl->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); + createdAndUploaded(image); } } -- cgit v0.12 From a891f20bc370c24777e22be40499e695f97738f9 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 4 Oct 2010 17:16:36 +0200 Subject: Fix performance regression in QUuid::createUuid() After commit 4363d4eebce4afd2ce3b3d6da205f8037357099a, createUuid() would create a QFile, open it, read from it, and destroy it. This resulted in a pretty serious performance regression (report says around 2000 times slower, I measured 3600 times slower on my machine). This change creates one QFile per thread (since QFile is not thread safe) and leaves the file open until the thread exits (at which point QThreadStorage deletes the QFile). This approach is around 600 times faster than the current code, which is around 6 times slower than the original. Unfortunately, it is not possible to restore the original performance without reintroducing the problems that the commit mentioned above had fixed. Benchmark is included. Task-number: QTBUG-13877 Reviewed-by: thiago Reviewed-by: mgoetz --- src/corelib/plugin/quuid.cpp | 67 ++++++++++++++-------- tests/benchmarks/corelib/corelib.pro | 3 +- tests/benchmarks/corelib/plugin/plugin.pro | 2 + tests/benchmarks/corelib/plugin/quuid/quuid.pro | 6 ++ .../benchmarks/corelib/plugin/quuid/tst_quuid.cpp | 66 +++++++++++++++++++++ 5 files changed, 118 insertions(+), 26 deletions(-) create mode 100644 tests/benchmarks/corelib/plugin/plugin.pro create mode 100644 tests/benchmarks/corelib/plugin/quuid/quuid.pro create mode 100644 tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index 6c1b6e7..983d249 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -582,48 +582,65 @@ QT_BEGIN_INCLUDE_NAMESPACE #include // for RAND_MAX QT_END_INCLUDE_NAMESPACE +#if !defined(QT_BOOTSTRAPPED) && defined(Q_OS_UNIX) +Q_GLOBAL_STATIC(QThreadStorage, devUrandomStorage); +#endif + QUuid QUuid::createUuid() { QUuid result; uint *data = &(result.data1); -#ifdef Q_OS_UNIX - QFile devUrandom; - devUrandom.setFileName(QLatin1String("/dev/urandom")); - if (devUrandom.open(QIODevice::ReadOnly)) { - qint64 numToRead = 4 * sizeof(uint); - devUrandom.read((char *) data, numToRead); // should read 128-bits of data +#if defined(Q_OS_UNIX) + QFile *devUrandom; +# if !defined(QT_BOOTSTRAPPED) + devUrandom = devUrandomStorage()->localData(); + if (!devUrandom) { + devUrandom = new QFile(QLatin1String("/dev/urandom")); + devUrandom->open(QIODevice::ReadOnly | QIODevice::Unbuffered); + devUrandomStorage()->setLocalData(devUrandom); + } +# else + QFile file(QLatin1String("/dev/urandom")); + devUrandom = &file; + devUrandom->open(QIODevice::ReadOnly | QIODevice::Unbuffered); +# endif + enum { AmountToRead = 4 * sizeof(uint) }; + if (devUrandom->isOpen() + && devUrandom->read((char *) data, AmountToRead) == AmountToRead) { + // we got what we wanted, nothing more to do + ; } else #endif { static const int intbits = sizeof(int)*8; static int randbits = 0; if (!randbits) { - int r = 0; + int r = 0; int max = RAND_MAX; do { ++r; } while ((max=max>>1)); randbits = r; } - // Seed the PRNG once per thread with a combination of current time, a - // stack address and a serial counter (since thread stack addresses are - // re-used). + // Seed the PRNG once per thread with a combination of current time, a + // stack address and a serial counter (since thread stack addresses are + // re-used). #ifndef QT_BOOTSTRAPPED - static QThreadStorage uuidseed; - if (!uuidseed.hasLocalData()) - { - int *pseed = new int; - static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2); - qsrand(*pseed = QDateTime::currentDateTime().toTime_t() - + quintptr(&pseed) - + serial.fetchAndAddRelaxed(1)); - uuidseed.setLocalData(pseed); - } + static QThreadStorage uuidseed; + if (!uuidseed.hasLocalData()) + { + int *pseed = new int; + static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2); + qsrand(*pseed = QDateTime::currentDateTime().toTime_t() + + quintptr(&pseed) + + serial.fetchAndAddRelaxed(1)); + uuidseed.setLocalData(pseed); + } #else - static bool seeded = false; - if (!seeded) - qsrand(QDateTime::currentDateTime().toTime_t() - + quintptr(&seeded)); + static bool seeded = false; + if (!seeded) + qsrand(QDateTime::currentDateTime().toTime_t() + + quintptr(&seeded)); #endif int chunks = 16 / sizeof(uint); @@ -631,7 +648,7 @@ QUuid QUuid::createUuid() uint randNumber = 0; for (int filled = 0; filled < intbits; filled += randbits) randNumber |= qrand()< +#include +#include + +class tst_bench_QUuid : public QObject +{ + Q_OBJECT + +public: + tst_bench_QUuid() + { } + +private slots: + void createUuid(); +}; + +void tst_bench_QUuid::createUuid() +{ + QBENCHMARK { + QUuid::createUuid(); + } +} + +QTEST_MAIN(tst_bench_QUuid); +#include "tst_quuid.moc" -- cgit v0.12 From 68f4fa74312241b70604127405bec90aba49c186 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Tue, 5 Oct 2010 11:23:13 +0300 Subject: Quick fix for OSX and Windows/Mingw compilation errors. On OSX AssertMacros.h header has macro called verify() and QRBTree::verify() function was substituted by this macro. On Windows/Mingw includes need to point to exported private include folder. Reviewed-by: Kim --- src/opengl/gl2paintengineex/qtriangulator.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index bf21240..b839b00 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -57,8 +57,8 @@ #include -#include "qgl_p.h" -#include "qglextensions_p.h" +#include +#include QT_BEGIN_NAMESPACE @@ -625,7 +625,7 @@ struct QRBTree // Return 1 if 'left' comes after 'right', 0 if equal, and -1 otherwise. // 'left' and 'right' cannot be null. int order(Node *left, Node *right); - inline bool verify() const; + inline bool validate() const; private: void rotateLeft(Node *node); @@ -1038,7 +1038,7 @@ bool QRBTree::checkRedBlackProperty(Node *top) const } template -inline bool QRBTree::verify() const +inline bool QRBTree::validate() const { return checkRedBlackProperty(root) && blackDepth(root) != -1; } @@ -2854,7 +2854,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() m_edges.at(j).node = node; m_edges.at(j).helper = i; m_edgeList.attachAfter(leftEdgeNode, node); - Q_ASSERT(m_edgeList.verify()); + Q_ASSERT(m_edgeList.validate()); } else { leftEdgeNode = searchEdgeLeftOfEdge(i); QRBTree::Node *node = m_edgeList.newNode(); @@ -2862,7 +2862,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() m_edges.at(i).node = node; m_edges.at(i).helper = i; m_edgeList.attachAfter(leftEdgeNode, node); - Q_ASSERT(m_edgeList.verify()); + Q_ASSERT(m_edgeList.validate()); } break; case MergeVertex: @@ -2881,7 +2881,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() diagonals.add(QPair(i, m_edges.at(i).helper)); if (m_edges.at(i).node) { m_edgeList.deleteNode(m_edges.at(i).node); - Q_ASSERT(m_edgeList.verify()); + Q_ASSERT(m_edgeList.validate()); } else { qWarning("Inconsistent polygon. (#5)"); } @@ -2890,7 +2890,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() diagonals.add(QPair(i, m_edges.at(j).helper)); if (m_edges.at(j).node) { m_edgeList.deleteNode(m_edges.at(j).node); - Q_ASSERT(m_edgeList.verify()); + Q_ASSERT(m_edgeList.validate()); } else { qWarning("Inconsistent polygon. (#6)"); } -- cgit v0.12 From faba550d704312a29d9485bcaaa506331f102301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 29 Sep 2010 13:13:27 +0200 Subject: Fixed arm X11 build. Without we get error: invalid conversion from 'const void*' to 'void*' Reviewed-by: Thiago Macieira --- src/corelib/arch/qatomic_arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/arch/qatomic_arm.h b/src/corelib/arch/qatomic_arm.h index 9df02a2..bca3375 100644 --- a/src/corelib/arch/qatomic_arm.h +++ b/src/corelib/arch/qatomic_arm.h @@ -107,7 +107,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() // kernel places a restartable cmpxchg implementation at a fixed address extern "C" typedef int (qt_atomic_eabi_cmpxchg_int_t)(int oldval, int newval, volatile int *ptr); -extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(void *oldval, void *newval, volatile void *ptr); +extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(const void *oldval, const void *newval, volatile void *ptr); #define qt_atomic_eabi_cmpxchg_int (*reinterpret_cast(0xffff0fc0)) #define qt_atomic_eabi_cmpxchg_ptr (*reinterpret_cast(0xffff0fc0)) -- cgit v0.12 From 8ed3d9e33de7b4ee93b007ebde16ce42885ba95c Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 5 Oct 2010 12:06:10 +0200 Subject: QtScript/JavaScriptCore: Backport random number generator seeding fix Backported changes: || || JavaScriptCore/wtf/RandomNumber.h should provide using WTF::* || || || Don't seed the JS random number generator from time() || Task-number: QTBUG-13440 Reviewed-by: Simon Hausmann --- .../javascriptcore/JavaScriptCore/ChangeLog | 31 ++++++++++++++++++++++ .../JavaScriptCore/runtime/JSGlobalData.cpp | 1 - .../JavaScriptCore/runtime/JSGlobalData.h | 2 -- .../JavaScriptCore/runtime/JSGlobalObject.h | 4 +++ .../JavaScriptCore/runtime/MathObject.cpp | 2 +- .../JavaScriptCore/wtf/RandomNumber.h | 3 +++ src/3rdparty/javascriptcore/VERSION | 4 +-- 7 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog index fbaf5d2..fd6c3f7 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog +++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog @@ -1,3 +1,24 @@ +2010-08-24 Oliver Hunt + + Reviewed by Geoff Garen. + + Don't seed the JS random number generator from time() + https://bugs.webkit.org/show_bug.cgi?id=41868 + + + Switch to using the secure random number generator to + seed the fast random generator, and make the generator + be per global object. + + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + * runtime/JSGlobalData.h: + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): + (JSC::JSGlobalObject::weakRandomNumber): + * runtime/MathObject.cpp: + (JSC::mathProtoFuncRandom): + 2010-06-18 Tucker Jay Reviewed by NOBODY (OOPS!). @@ -94,6 +115,16 @@ * wtf/Platform.h: +2010-05-06 Fumitoshi Ukai + + Reviewed by Alexey Proskuryakov. + + JavaScriptCore/wtf/RandomNumber.h should provide using WTF::* + https://bugs.webkit.org/show_bug.cgi?id=38719 + + * wtf/RandomNumber.h: + Add using directives. + 2010-04-28 Simon Hausmann , Kent Hansen Reviewed by Darin Adler. diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp index 34b5f82..1c25c16 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp @@ -144,7 +144,6 @@ JSGlobalData::JSGlobalData(bool isShared) , firstStringifierToMark(0) , markStack(jsArrayVPtr) , cachedUTCOffset(NaN) - , weakRandom(static_cast(currentTime())) #ifndef NDEBUG , mainThreadOnly(false) #endif diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h index 49a6c4c..dcd3289 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h @@ -184,8 +184,6 @@ namespace JSC { UString cachedDateString; double cachedDateStringValue; - - WeakRandom weakRandom; #ifndef NDEBUG bool mainThreadOnly; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h index 340e04d..7c20272 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h @@ -31,6 +31,7 @@ #include "StructureChain.h" #include #include +#include namespace JSC { @@ -91,6 +92,7 @@ namespace JSC { , datePrototype(0) , regExpPrototype(0) , methodCallDummy(0) + , weakRandom(static_cast(randomNumber() * (std::numeric_limits::max() + 1.0))) { } @@ -154,6 +156,7 @@ namespace JSC { RefPtr globalData; HashSet codeBlocks; + WeakRandom weakRandom; }; public: @@ -271,6 +274,7 @@ namespace JSC { return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); } + double weakRandomNumber() { return d()->weakRandom.get(); } protected: static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp index 8f22fba..807cfe7 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp @@ -210,7 +210,7 @@ JSValue JSC_HOST_CALL mathProtoFuncPow(ExecState* exec, JSObject*, JSValue, cons JSValue JSC_HOST_CALL mathProtoFuncRandom(ExecState* exec, JSObject*, JSValue, const ArgList&) { - return jsDoubleNumber(exec, exec->globalData().weakRandom.get()); + return jsDoubleNumber(exec, exec->lexicalGlobalObject()->weakRandomNumber()); } JSValue JSC_HOST_CALL mathProtoFuncRound(ExecState* exec, JSObject*, JSValue, const ArgList& args) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.h index fe1687c..e54e9ae 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.h @@ -39,4 +39,7 @@ namespace WTF { } +using WTF::randomNumber; +using WTF::weakRandomNumber; + #endif diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION index 6f5fb7c..9991ac0 100644 --- a/src/3rdparty/javascriptcore/VERSION +++ b/src/3rdparty/javascriptcore/VERSION @@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from The commit imported was from the - javascriptcore-snapshot-28062010 branch/tag + javascriptcore-snapshot-05102010 branch/tag and has the sha1 checksum - 0fccd26d3624e80cf68873701ef70ad72ca66bec + 82ead85cfea5859044eeb25b33314dcc0fa5eea1 -- cgit v0.12 From b3f895fd97deda0c7c5bfd704c04450e7afee748 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Tue, 5 Oct 2010 16:43:33 +0300 Subject: QS60Style: QDateEdit - Layout issues In portrait orientation, QDateEdit's calendar popup (QCalendarWidget) does not fit into screen. As a fix, the pixel metric PM_FocusFrameHMargin, is reduced from 13 to 3 in qHD screens (640*360). Also, the explicit halving of the pixel metric for QTableViews is removed. The pixel metric resulted in 27 pixel text margins (2 * pm + 1)for calendar widgets, which is clearly a bit too much. Task-number: QTBUG-14126 Reviewed-by: Miikka Heikkinen --- src/gui/styles/qs60style.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 3a01f3f..718774e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -106,8 +106,8 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { // *** generated pixel metrics *** {5,0,-909,0,0,2,0,0,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106}, {5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106}, -{7,0,-909,0,0,2,0,0,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,13,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, -{7,0,-909,0,0,2,0,0,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,12,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,0,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,0,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, {7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106} // *** End of generated data *** }; @@ -2530,11 +2530,6 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const //without having to define custom pixel metric metricValue *= 2; - if (widget && (metric == PM_FocusFrameHMargin)) - if (qobject_cast(widget)) - //Halve the focus frame margin for table items - metricValue /= 2; - return metricValue; } -- cgit v0.12 From 7bf2de5adf62f45c8d7fcba22e2cf9ea427b5b37 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Tue, 5 Oct 2010 16:54:20 +0200 Subject: Adding a threshold for partial updates. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 841 Reviewed-by: Samuel Rødal --- src/opengl/qwindowsurface_gl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index f98dcff..8157b2a 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -534,8 +534,9 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & } } #endif - if (d_ptr->paintedRegion.boundingRect() != geometry() && - hasPartialUpdateSupport()) { + if (hasPartialUpdateSupport() && + d_ptr->paintedRegion.boundingRect().width() * d_ptr->paintedRegion.boundingRect().height() < + geometry().width() * geometry().height() * 0.2) { context()->d_func()->swapRegion(&d_ptr->paintedRegion); } else context()->swapBuffers(); -- cgit v0.12 From cace0a51e21ff8275b887025b562fc79bec9f32f Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Tue, 5 Oct 2010 11:28:35 -0500 Subject: Revert "QWorkspace: fix hardcoded min size overwriting the real min size" This reverts commit b3a46493a1a74bd7918bd68638c28cf6e84eb57f. --- src/gui/widgets/qworkspace.cpp | 15 ++++++--------- tests/auto/qworkspace/tst_qworkspace.cpp | 10 ---------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/gui/widgets/qworkspace.cpp b/src/gui/widgets/qworkspace.cpp index 3a9b30c..7180c4d 100644 --- a/src/gui/widgets/qworkspace.cpp +++ b/src/gui/widgets/qworkspace.cpp @@ -2551,6 +2551,7 @@ QWorkspaceChild::QWorkspaceChild(QWidget* window, QWorkspace *parent, Qt::Window this, SLOT(titleBarDoubleClicked())); } + setMinimumSize(128, 0); int fw = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, this); setContentsMargins(fw, fw, fw, fw); @@ -2701,15 +2702,11 @@ QSize QWorkspaceChild::sizeHint() const QSize QWorkspaceChild::minimumSizeHint() const { - QSize s; - if (!childWidget) { - s = QWidget::minimumSizeHint(); - } else { - s = childWidget->minimumSize(); - if (s.isEmpty()) - s = childWidget->minimumSizeHint(); - } - s = s.expandedTo(QSize(128, 0)); + if (!childWidget) + return QWidget::minimumSizeHint() + baseSize(); + QSize s = childWidget->minimumSize(); + if (s.isEmpty()) + s = childWidget->minimumSizeHint(); return s + baseSize(); } diff --git a/tests/auto/qworkspace/tst_qworkspace.cpp b/tests/auto/qworkspace/tst_qworkspace.cpp index 9039eb3..4cf76b5 100644 --- a/tests/auto/qworkspace/tst_qworkspace.cpp +++ b/tests/auto/qworkspace/tst_qworkspace.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #if defined(QT3_SUPPORT) #include @@ -592,25 +591,16 @@ void tst_QWorkspace::childSize() MyChild *child = new MyChild(&ws); child->show(); - ws.addWindow(child); QCOMPARE(child->size(), child->sizeHint()); delete child; child = new MyChild(&ws); child->setFixedSize(200, 200); child->show(); - ws.addWindow(child); QCOMPARE(child->size(), child->minimumSize()); - QCOMPARE(child->parentWidget()->metaObject()->className(), "QWorkspaceChild"); - QVERIFY(child->parentWidget()->width() >= 200); - // check that the minimum size is respected, using closestAcceptableSize - // like QSizeGrip does. - const QSize newSize = QLayout::closestAcceptableSize(child->parentWidget(), QSize(100, 100)); - QVERIFY(newSize.width() >= 200); delete child; child = new MyChild(&ws); - ws.addWindow(child); child->resize(150, 150); child->show(); QCOMPARE(child->size(), QSize(150,150)); -- cgit v0.12 From 07256884f745e93d98687b213d037baf4be538a1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 5 Oct 2010 17:20:31 +0200 Subject: make custom command handling in vc(x)proj files sane instead of glueing the commands with "&&" and having a monster hack (\r\h) for the case where they cannot be and-ed, glue them with newlines and error checks. this ensures that we a) never have excessively long lines, b) don't need the monster hack and c) commands always have proper error checks, just like in makefiles. Reviewed-by: mariusSO --- qmake/generators/win32/msbuild_objectmodel.cpp | 44 ++++++++--------------- qmake/generators/win32/msbuild_objectmodel.h | 2 +- qmake/generators/win32/msvc_objectmodel.cpp | 49 +++++++++++--------------- qmake/generators/win32/msvc_objectmodel.h | 3 +- qmake/generators/win32/msvc_vcproj.cpp | 26 ++++---------- qmake/generators/win32/msvc_vcproj.h | 1 - qmake/generators/win32/msvc_vcxproj.cpp | 14 ++++---- 7 files changed, 50 insertions(+), 89 deletions(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 2505056..c963f46 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -377,6 +377,16 @@ inline XmlOutput::xml_output valueTagT( const triState v) } +static QString vcxCommandSeparator() +{ + // MSBuild puts the contents of the custom commands into a batch file and calls it. + // As we want every sub-command to be error-checked (as is done by makefile-based + // backends), we insert the checks ourselves, using the undocumented jump target. + static QString cmdSep = + QLatin1String(" if errorlevel 1 goto VCEnd "); + return cmdSep; +} + // VCXCLCompilerTool ------------------------------------------------- VCXCLCompilerTool::VCXCLCompilerTool() : BrowseInformation(_False), @@ -2142,32 +2152,6 @@ VCXCustomBuildTool::VCXCustomBuildTool() XmlOutput &operator<<(XmlOutput &xml, const VCXCustomBuildTool &tool) { - // The code below offers two ways to split custom build step commands. - // Normally the $$escape_expand(\n\t) is used in a project file, which is correctly translated - // in all generators. However, if you use $$escape_expand(\n\r) (or \n\h) instead, the VCPROJ - // generator will instead of binding the commands with " && " will insert a proper newline into - // the VCPROJ file. We sometimes use this method of splitting commands if the custom buildstep - // contains a command-line which is too big to run on certain OS. - QString cmds; - int end = tool.CommandLine.count(); - for(int i = 0; i < end; ++i) { - QString cmdl = tool.CommandLine.at(i); - if (cmdl.contains("\r\t")) { - if (i == end - 1) - cmdl = cmdl.trimmed(); - cmdl.replace("\r\t", " && "); - } else if (cmdl.contains("\r\n")) { - ; - } else if (cmdl.contains("\r\\h")) { - // The above \r\n should work, but doesn't, so we have this hack - cmdl.replace("\r\\h", "\r\n"); - } else { - if (i < end - 1) - cmdl += " && "; - } - cmds += cmdl; - } - if ( !tool.AdditionalDependencies.isEmpty() ) { xml << tag("AdditionalInputs") @@ -2175,11 +2159,11 @@ XmlOutput &operator<<(XmlOutput &xml, const VCXCustomBuildTool &tool) << valueTagDefX(tool.AdditionalDependencies, "AdditionalInputs", ";"); } - if( !cmds.isEmpty() ) + if( !tool.CommandLine.isEmpty() ) { xml << tag("Command") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) - << valueTag(cmds); + << valueTag(tool.CommandLine.join(vcxCommandSeparator())); } if ( !tool.Description.isEmpty() ) @@ -2249,7 +2233,7 @@ XmlOutput &operator<<(XmlOutput &xml, const VCXEventTool &tool) { return xml << tag(tool.EventName) - << attrTagS(_Command, tool.CommandLine) + << attrTagS(_Command, tool.CommandLine.join(vcxCommandSeparator())) << attrTagS(_Message, tool.Description) << closetag(tool.EventName); } @@ -2525,7 +2509,7 @@ bool VCXFilter::addExtraCompiler(const VCXFilterFile &info) if (!CustomBuildTool.Description.isEmpty()) CustomBuildTool.Description += " & "; CustomBuildTool.Description += cmd_name; - CustomBuildTool.CommandLine += cmd.trimmed().split("\n", QString::SkipEmptyParts); + CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed()); int space = cmd.indexOf(' '); QFileInfo finf(cmd.left(space)); if (CustomBuildTool.ToolPath.isEmpty()) diff --git a/qmake/generators/win32/msbuild_objectmodel.h b/qmake/generators/win32/msbuild_objectmodel.h index 567985d..acca6c1 100644 --- a/qmake/generators/win32/msbuild_objectmodel.h +++ b/qmake/generators/win32/msbuild_objectmodel.h @@ -382,7 +382,7 @@ protected: public: // Variables - QString CommandLine; + QStringList CommandLine; QString Description; triState UseInBuild; QString EventName; diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 980e686..df414ea 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -280,6 +280,24 @@ inline XmlOutput::xml_output attrX(const char *name, const QStringList &v, const return attr(name, v.join(s)); } +// VCToolBase ------------------------------------------------- +QStringList VCToolBase::fixCommandLine(const QString &input) +{ + // The splitting regexp is a bit bizarre for backwards compat reasons (why else ...). + return input.split(QRegExp(QLatin1String("\n\t|\r\\h|\r\n"))); +} + +static QString vcCommandSeparator() +{ + // MSVC transforms the build tree into a single batch file, simply pasting the contents + // of the custom commands into it, and putting an "if errorlevel goto" statement behind it. + // As we want every sub-command to be error-checked (as is done by makefile-based + // backends), we insert the checks ourselves, using the undocumented jump target. + static QString cmdSep = + QLatin1String(" if errorlevel 1 goto VCReportError "); + return cmdSep; +} + // VCCLCompilerTool ------------------------------------------------- VCCLCompilerTool::VCCLCompilerTool() : AssemblerOutput(asmListingNone), @@ -1913,36 +1931,11 @@ VCCustomBuildTool::VCCustomBuildTool() XmlOutput &operator<<(XmlOutput &xml, const VCCustomBuildTool &tool) { - // The code below offers two ways to split custom build step commands. - // Normally the $$escape_expand(\n\t) is used in a project file, which is correctly translated - // in all generators. However, if you use $$escape_expand(\n\r) (or \n\h) instead, the VCPROJ - // generator will instead of binding the commands with " && " will insert a proper newline into - // the VCPROJ file. We sometimes use this method of splitting commands if the custom buildstep - // contains a command-line which is too big to run on certain OS. - QString cmds; - int end = tool.CommandLine.count(); - for(int i = 0; i < end; ++i) { - QString cmdl = tool.CommandLine.at(i); - if (cmdl.contains("\r\t")) { - if (i == end - 1) - cmdl = cmdl.trimmed(); - cmdl.replace("\r\t", " && "); - } else if (cmdl.contains("\r\n")) { - ; - } else if (cmdl.contains("\r\\h")) { - // The above \r\n should work, but doesn't, so we have this hack - cmdl.replace("\r\\h", "\r\n"); - } else { - if (i < end - 1) - cmdl += " && "; - } - cmds += cmdl; - } return xml << tag(_Tool) << attrS(_Name, tool.ToolName) << attrX(_AdditionalDependencies, tool.AdditionalDependencies, ";") - << attrS(_CommandLine, cmds) + << attrS(_CommandLine, tool.CommandLine.join(vcCommandSeparator())) << attrS(_Description, tool.Description) << attrX(_Outputs, tool.Outputs, ";") << attrS(_Path, tool.ToolPath) @@ -2002,7 +1995,7 @@ XmlOutput &operator<<(XmlOutput &xml, const VCEventTool &tool) << tag(_Tool) << attrS(_Name, tool.ToolName) << attrS(_Path, tool.ToolPath) - << attrS(_CommandLine, tool.CommandLine) + << attrS(_CommandLine, tool.CommandLine.join(vcCommandSeparator())) << attrS(_Description, tool.Description) << attrT(_ExcludedFromBuild, tool.ExcludedFromBuild) << closetag(_Tool); @@ -2296,7 +2289,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) if (!CustomBuildTool.Description.isEmpty()) CustomBuildTool.Description += " & "; CustomBuildTool.Description += cmd_name; - CustomBuildTool.CommandLine += cmd.trimmed().split("\n", QString::SkipEmptyParts); + CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed()); int space = cmd.indexOf(' '); QFileInfo finf(cmd.left(space)); if (CustomBuildTool.ToolPath.isEmpty()) diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 97f8570..22013e0 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -475,6 +475,7 @@ public: for (QStringList::ConstIterator it=options.begin(); (it!=options.end()); it++) parseOption((*it).toLatin1()); } + static QStringList fixCommandLine(const QString &input); }; class VCConfiguration; @@ -746,7 +747,7 @@ protected: public: // Variables - QString CommandLine; + QStringList CommandLine; QString Description; triState ExcludedFromBuild; QString ToolName; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 8686ae8..cff7a14 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1027,37 +1027,23 @@ void VcprojGenerator::initPreBuildEventTools() { } -QString VcprojGenerator::fixCommandLine(DotNET version, const QString &input) const -{ - QString result = input; - - if (version >= NET2005) - result = result.replace(QLatin1Char('\n'), QLatin1String(" ")); - - return result; -} - void VcprojGenerator::initPostBuildEventTools() { VCConfiguration &conf = vcProject.Configuration; if(!project->values("QMAKE_POST_LINK").isEmpty()) { - QString cmdline = fixCommandLine(conf.CompilerVersion, var("QMAKE_POST_LINK")); + QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_POST_LINK")); conf.postBuild.CommandLine = cmdline; - if (conf.CompilerVersion < NET2005) - cmdline = cmdline.replace("\n", "&&"); - conf.postBuild.Description = cmdline; + conf.postBuild.Description = cmdline.join(QLatin1String("\r\n")); } QString signature = !project->isEmpty("SIGNATURE_FILE") ? var("SIGNATURE_FILE") : var("DEFAULT_SIGNATURE"); bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); if(useSignature) - conf.postBuild.CommandLine.prepend(QLatin1String("signtool sign /F ") + signature + " \"$(TargetPath)\"\n" + - (!conf.postBuild.CommandLine.isEmpty() ? " && " : "")); + conf.postBuild.CommandLine.prepend( + QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\"")); if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { - if(!conf.postBuild.CommandLine.isEmpty()) - conf.postBuild.CommandLine += " && "; conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC"); conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL"); } @@ -1186,9 +1172,9 @@ void VcprojGenerator::initPreLinkEventTools() { VCConfiguration &conf = vcProject.Configuration; if(!project->values("QMAKE_PRE_LINK").isEmpty()) { - QString cmdline = fixCommandLine(conf.CompilerVersion, var("QMAKE_PRE_LINK")); - conf.preLink.Description = cmdline; + QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_PRE_LINK")); conf.preLink.CommandLine = cmdline; + conf.preLink.Description = cmdline.join(QLatin1String("\r\n")); } } diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 8f028a1..05e765e 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -130,7 +130,6 @@ protected: QList mergedProjects; private: - QString fixCommandLine(DotNET version, const QString &input) const; QUuid increaseUUID(const QUuid &id); friend class VCFilter; }; diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index 271d9ae..396d2bf 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -380,9 +380,9 @@ void VcxprojGenerator::initPostBuildEventTools() { VCXConfiguration &conf = vcxProject.Configuration; if(!project->values("QMAKE_POST_LINK").isEmpty()) { - QString cmdline = var("QMAKE_POST_LINK"); + QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_POST_LINK")); conf.postBuild.CommandLine = cmdline; - conf.postBuild.Description = cmdline; + conf.postBuild.Description = cmdline.join(QLatin1String("\r\n")); conf.postBuild.UseInBuild = _True; } @@ -390,14 +390,12 @@ void VcxprojGenerator::initPostBuildEventTools() bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); if(useSignature) { - conf.postBuild.CommandLine.prepend(QLatin1String("signtool sign /F ") + signature + " \"$(TargetPath)\"\n" + - (!conf.postBuild.CommandLine.isEmpty() ? " && " : "")); + conf.postBuild.CommandLine.prepend( + QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\"")); conf.postBuild.UseInBuild = _True; } if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { - if(!conf.postBuild.CommandLine.isEmpty()) - conf.postBuild.CommandLine += " && "; conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC"); conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL"); conf.postBuild.UseInBuild = _True; @@ -530,9 +528,9 @@ void VcxprojGenerator::initPreLinkEventTools() { VCXConfiguration &conf = vcxProject.Configuration; if(!project->values("QMAKE_PRE_LINK").isEmpty()) { - QString cmdline = var("QMAKE_PRE_LINK"); - conf.preLink.Description = cmdline; + QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_PRE_LINK")); conf.preLink.CommandLine = cmdline; + conf.preLink.Description = cmdline.join(QLatin1String("\r\n")); conf.preLink.UseInBuild = _True; } } -- cgit v0.12 From 474295602d473078aebff00a8d2e8265cdc5d424 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 5 Oct 2010 19:12:02 +0200 Subject: make QMAKE_POST_LINK handling in nmake generator sane there is no point in &&-ing it with a possibly present signature command - putting it on a line of its own works just fine - with the added benefit of not breaking if it contains operators itself. Reviewed-by: mariusSO --- qmake/generators/win32/msvc_nmake.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 92e8aeb..907f8dc 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -310,10 +310,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) t << "\n\tsigntool sign /F " << signature << " $(DESTDIR_TARGET)"; } if(!project->isEmpty("QMAKE_POST_LINK")) { - if (useSignature) - t << " && " << var("QMAKE_POST_LINK"); - else - t << "\n\t" << var("QMAKE_POST_LINK"); + t << "\n\t" << var("QMAKE_POST_LINK"); } t << endl; } -- cgit v0.12 From edb1e43f0ad7aece24929d95542490da7f88321f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 5 Oct 2010 19:27:00 +0200 Subject: rebuild configure.exe --- configure.exe | Bin 1402368 -> 1325568 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index e2f4331..f8d520a 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From d75dad653d651eb725b238ad9db4dccd6a1f1d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 5 Oct 2010 18:12:03 +0200 Subject: qmake: Ensure right library order when reducing duplicate libraries Commit 3ed9e2788e8 changed the logic from using lookahead to checking if the library already existed in the arguments parsed so far. This broke the case -lFoo -lBar -lFoo where Bar depends on symbols in Foo. Since we were reducing this to -lFoo -lBar, the linker would not know which missing symbols to include from Foo when encountering the -lFoo argument. We now keep the library order when building the final argument list, by making sure the position of a duplicated library is always that of the last instance of that library. Task-number: QTBUG-13944 Reviewed-by: Simon Hausmann --- qmake/generators/unix/unixmake.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index da4bbb7..c26fcb4 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -636,11 +636,13 @@ UnixMakefileGenerator::processPrlFiles() if(opt.startsWith("-L") || (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-F"))) { - if(lit == 0 || !lflags[arch].contains(opt)) + if(!lflags[arch].contains(opt)) lflags[arch].append(opt); } else if(opt.startsWith("-l")) { - if(lit == l.size()-1 || !lflags[arch].contains(opt)) - lflags[arch].append(opt); + // Make sure we keep the dependency-order of libraries + if (lflags[arch].contains(opt)) + lflags[arch].removeAll(opt); + lflags[arch].append(opt); } else if(Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-framework")) { if(opt.length() > 11) opt = opt.mid(11); @@ -672,7 +674,7 @@ UnixMakefileGenerator::processPrlFiles() lflags[arch].append(opt); } } else if(!opt.isNull()) { - if(lit == 0 || l.lastIndexOf(opt, lit-1) == -1) + if(!lflags[arch].contains(opt)) lflags[arch].append(opt); } } -- cgit v0.12 From 9c2361fa3b0ce2417a26537a3ecfe17c2b3ca6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 5 Oct 2010 18:23:57 +0200 Subject: qmake: Include -pthread when reducing duplicate library arguments Reviwed-by: Simon Hausmann --- qmake/generators/unix/unixmake.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index c26fcb4..71a6061 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -638,7 +638,7 @@ UnixMakefileGenerator::processPrlFiles() (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-F"))) { if(!lflags[arch].contains(opt)) lflags[arch].append(opt); - } else if(opt.startsWith("-l")) { + } else if(opt.startsWith("-l") || opt == "-pthread") { // Make sure we keep the dependency-order of libraries if (lflags[arch].contains(opt)) lflags[arch].removeAll(opt); -- cgit v0.12 From 9979154d2fd757396ef4685dbbb9bad95c3bf7ff Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 6 Oct 2010 10:02:45 +0300 Subject: QS60Style: Highlighted TreeBranch indicator is incorrect Part of the fix for QTBUG-13553 incorrectly uses commonstyle to draw branch highlight, when it should use QS60Style. As a fix, commonstyle should not be used unless theme palette has been tempered with. Task-number: QTBUG-13699 Reviewed-by: Miikka Heikkinen --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 718774e..1e32bd8 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2453,7 +2453,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_PanelItemViewRow: // ### Qt 5: remove #ifndef QT_NO_ITEMVIEWS if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(option)) { - if (QS60StylePrivate::equalToThemePalette(vopt->palette.base().texture().cacheKey(), QPalette::Base)) { + if (!QS60StylePrivate::equalToThemePalette(vopt->palette.base().texture().cacheKey(), QPalette::Base)) { //QPalette::Base has been changed, let commonstyle draw the item commonStyleDraws = true; } else { -- cgit v0.12 From 97d436160c87876cdc272b3ce0bb09256d78405c Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 6 Oct 2010 09:54:15 +0200 Subject: Remove unused/incorrect TFX commands pertaining to layers on Symbian. These commands have been renamed in the Symbian^4 code line, but since they are not currently used by the effects engine, we simply remove them for now to avoid causing build breakages on platforms that use the older version. Reviewed-by: Jani Hautakangas --- src/gui/kernel/qapplication_s60.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 1127c84..296f24f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -152,18 +152,12 @@ void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible) if (backingStore.data()) { backingStore.registerWidget(widget); } else { -#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS - S60->wsSession().SendEffectCommand(ETfxCmdRestoreLayer); -#endif backingStore.create(window); backingStore.registerWidget(widget); qt_widget_private(widget)->invalidateBuffer(widget->rect()); widget->repaint(); } } else { -#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS - S60->wsSession().SendEffectCommand(ETfxCmdDeallocateLayer); -#endif backingStore.unregisterWidget(widget); // In order to ensure that any resources used by the window surface // are immediately freed, we flush the WSERV command buffer. -- cgit v0.12 From d1e415f30b080f0aafefb13aa402634e5710b343 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 6 Oct 2010 10:14:21 +0200 Subject: Define QVG_SCISSOR_CLIP for QtOpenVG on Symbian. I avoided adding this flag for ages since I wasn't convinced that it was needed on all Symbian OpenVG hardware, but not having it has caused more problems since people report problems when it is not enabled. Simple solution is just to add it. Task-number: QTBUG-11311 Reviewed-by: Jani Hautakangas --- src/openvg/openvg.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvg/openvg.pro b/src/openvg/openvg.pro index eb60331..c05af90 100644 --- a/src/openvg/openvg.pro +++ b/src/openvg/openvg.pro @@ -35,7 +35,7 @@ contains(QT_CONFIG, egl) { } symbian { - DEFINES += QVG_RECREATE_ON_SIZE_CHANGE QVG_BUFFER_SCROLLING + DEFINES += QVG_RECREATE_ON_SIZE_CHANGE QVG_BUFFER_SCROLLING QVG_SCISSOR_CLIP SOURCES += \ qvg_symbian.cpp } -- cgit v0.12 From 6b118e981b0da4e7bcfd99be6ba1d0123885e7b3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 6 Oct 2010 10:29:55 +0200 Subject: fix regexp in "make custom command handling in vc(x)proj files sane" --- qmake/generators/win32/msvc_objectmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index df414ea..f5ca1be 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -284,7 +284,7 @@ inline XmlOutput::xml_output attrX(const char *name, const QStringList &v, const QStringList VCToolBase::fixCommandLine(const QString &input) { // The splitting regexp is a bit bizarre for backwards compat reasons (why else ...). - return input.split(QRegExp(QLatin1String("\n\t|\r\\h|\r\n"))); + return input.split(QRegExp(QLatin1String("\n\t|\r\\\\h|\r\n"))); } static QString vcCommandSeparator() -- cgit v0.12 From 62ee836fafe515c03b0be716585f8c2354e188f7 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 5 Oct 2010 17:39:57 +0200 Subject: Fix copying large data to non-Qt applications In send_selection when we decide to use INCR properties we set the given property value to be INCR atom, however we were also sending SelectionNotify event containing the name of the property that the client should watch as INCR, which is wrong, we should send the original property that we were asked to use instead. This fixes copying large junks of data from Qt application, for example copying text (>200k) to gedit or images to gimp. Task-number: QTBUG-8644 Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qclipboard_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index 4b75f0a..b7ca2d4 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -836,7 +836,7 @@ static Atom send_selection(QClipboardData *d, Atom target, Window window, Atom p ATOM(INCR), 32, PropModeReplace, (uchar *) &bytes, 1); (void)new QClipboardINCRTransaction(window, property, atomFormat, dataFormat, data, increment); - return ATOM(INCR); + return property; } // make sure we can perform the XChangeProperty in a single request -- cgit v0.12 From 4b81cb847647450f4bad8a0d9a278d43ebdfecc6 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 6 Oct 2010 10:31:37 +0200 Subject: Fixed a buffer overrun when pasting large data from non-Qt apps When we receive a COMPOUND_TEXT data and convert it to multi-byte, if the new length is less than the original buffer, we resize the buffer, but then we need to make sure we reset the buffer_offset variable, which is returned as a "size" of the buffer to a caller. The conversion to COMPOUND_TEXT format was totally wrong, we were using the wrong length of the input text, so the converted string was truncated. Task-number: QTBUG-8644 Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qclipboard_x11.cpp | 22 +++++++++------------- src/gui/kernel/qdnd_x11.cpp | 2 +- src/gui/kernel/qmotifdnd_x11.cpp | 2 +- src/gui/kernel/qt_x11_p.h | 2 +- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index b7ca2d4..55548ef 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -595,7 +595,7 @@ static inline int maxSelectionIncr(Display *dpy) { return XMaxRequestSize(dpy) > 65536 ? 65536*4 : XMaxRequestSize(dpy)*4 - 100; } bool QX11Data::clipboardReadProperty(Window win, Atom property, bool deleteProperty, - QByteArray *buffer, int *size, Atom *type, int *format, bool nullterm) + QByteArray *buffer, int *size, Atom *type, int *format) { int maxsize = maxSelectionIncr(display); ulong bytes_left; // bytes_after @@ -641,13 +641,13 @@ bool QX11Data::clipboardReadProperty(Window win, Atom property, bool deletePrope break; } - int newSize = proplen + (nullterm ? 1 : 0); + int newSize = proplen; buffer->resize(newSize); bool ok = (buffer->size() == newSize); VDEBUG("QClipboard: read_property(): buffer resized to %d", buffer->size()); - if (ok) { + if (ok && newSize) { // could allocate buffer while (bytes_left) { @@ -683,23 +683,19 @@ bool QX11Data::clipboardReadProperty(Window win, Atom property, bool deletePrope XTextProperty textprop; textprop.encoding = *type; textprop.format = *format; - textprop.nitems = length; + textprop.nitems = buffer_offset; textprop.value = (unsigned char *) buffer->data(); char **list_ret = 0; int count; if (XmbTextPropertyToTextList(display, &textprop, &list_ret, &count) == Success && count && list_ret) { - offset = strlen(list_ret[0]); - buffer->resize(offset + (nullterm ? 1 : 0)); + offset = buffer_offset = strlen(list_ret[0]); + buffer->resize(offset); memcpy(buffer->data(), list_ret[0], offset); } if (list_ret) XFreeStringList(list_ret); } - - // zero-terminate (for text) - if (nullterm) - buffer->data()[buffer_offset] = '\0'; } // correct size, not 0-term. @@ -742,7 +738,7 @@ QByteArray QX11Data::clipboardReadIncrementalProperty(Window win, Atom property, if (event.xproperty.atom != property || event.xproperty.state != PropertyNewValue) continue; - if (X11->clipboardReadProperty(win, property, true, &tmp_buf, &length, 0, 0, false)) { + if (X11->clipboardReadProperty(win, property, true, &tmp_buf, &length, 0, 0)) { if (length == 0) { // no more data, we're done if (nullterm) { buf.resize(offset+1); @@ -1070,7 +1066,7 @@ bool QClipboard::event(QEvent *e) QByteArray multi_data; if (req->property == XNone || !X11->clipboardReadProperty(req->requestor, req->property, false, &multi_data, - 0, &multi_type, &multi_format, 0) + 0, &multi_type, &multi_format) || multi_format != 32) { // MULTIPLE property not formatted correctly XSendEvent(dpy, req->requestor, False, NoEventMask, &event); @@ -1292,7 +1288,7 @@ QByteArray QClipboardWatcher::getDataInFormat(Atom fmtatom) const Atom type; XSelectInput(dpy, win, PropertyChangeMask); - if (X11->clipboardReadProperty(win, ATOM(_QT_SELECTION), true, &buf, 0, &type, 0, false)) { + if (X11->clipboardReadProperty(win, ATOM(_QT_SELECTION), true, &buf, 0, &type, 0)) { if (type == ATOM(INCR)) { int nbytes = buf.size() >= 4 ? *((int*)buf.data()) : 0; buf = X11->clipboardReadIncrementalProperty(win, ATOM(_QT_SELECTION), nbytes, false); diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 92dd0a1..68d7688 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -1887,7 +1887,7 @@ static QVariant xdndObtainData(const char *format, QVariant::Type requestedType) if (got) { Atom type; - if (X11->clipboardReadProperty(tw->effectiveWinId(), ATOM(XdndSelection), true, &result, 0, &type, 0, false)) { + if (X11->clipboardReadProperty(tw->effectiveWinId(), ATOM(XdndSelection), true, &result, 0, &type, 0)) { if (type == ATOM(INCR)) { int nbytes = result.size() >= 4 ? *((int*)result.data()) : 0; result = X11->clipboardReadIncrementalProperty(tw->effectiveWinId(), ATOM(XdndSelection), nbytes, false); diff --git a/src/gui/kernel/qmotifdnd_x11.cpp b/src/gui/kernel/qmotifdnd_x11.cpp index 0a7b350..3334455 100644 --- a/src/gui/kernel/qmotifdnd_x11.cpp +++ b/src/gui/kernel/qmotifdnd_x11.cpp @@ -766,7 +766,7 @@ QVariant QX11Data::motifdndObtainData(const char *mimeType) if (got) { Atom type; - if (X11->clipboardReadProperty(tw->internalWinId(), Dnd_selection, true, &result, 0, &type, 0, false)) { + if (X11->clipboardReadProperty(tw->internalWinId(), Dnd_selection, true, &result, 0, &type, 0)) { } } diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index 7383382..d62d9c3 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -350,7 +350,7 @@ struct QX11Data // from qclipboard_x11.cpp bool clipboardWaitForEvent(Window win, int type, XEvent *event, int timeout); bool clipboardReadProperty(Window win, Atom property, bool deleteProperty, - QByteArray *buffer, int *size, Atom *type, int *format, bool nullterm); + QByteArray *buffer, int *size, Atom *type, int *format); QByteArray clipboardReadIncrementalProperty(Window win, Atom property, int nbytes, bool nullterm); // from qdnd_x11.cpp -- cgit v0.12 From e98962aab2db1c3760b324d6640fa8b510b7e04c Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 6 Oct 2010 12:46:45 +0200 Subject: tst_qtcpsocket: Attempt to reproduce QTBUG-14268 The test (un)fortunately passes :-) Task-number: QTBUG-14268 --- tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 31cae40..5b77006 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -201,6 +201,9 @@ private slots: void proxyFactory_data(); void proxyFactory(); + void qtbug14268_peek(); + + protected slots: void nonBlockingIMAP_hostFound(); void nonBlockingIMAP_connected(); @@ -251,6 +254,41 @@ enum ProxyTests { int tst_QTcpSocket::loopLevel = 0; +class SocketPair: public QObject +{ + Q_OBJECT +public: + QTcpSocket *endPoints[2]; + + SocketPair(QObject *parent = 0) + : QObject(parent) + { + endPoints[0] = endPoints[1] = 0; + } + + bool create() + { + QTcpServer server; + server.listen(); + + QTcpSocket *active = new QTcpSocket(this); + active->connectToHost("127.0.0.1", server.serverPort()); + + if (!active->waitForConnected(1000)) + return false; + + if (!server.waitForNewConnection(1000)) + return false; + + QTcpSocket *passive = server.nextPendingConnection(); + passive->setParent(this); + + endPoints[0] = active; + endPoints[1] = passive; + return true; + } +}; + tst_QTcpSocket::tst_QTcpSocket() { Q_SET_DEFAULT_IAP @@ -2467,6 +2505,39 @@ void tst_QTcpSocket::proxyFactory() delete socket; } +void tst_QTcpSocket::qtbug14268_peek() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + SocketPair socketPair; + QVERIFY(socketPair.create()); + QTcpSocket *outgoing = socketPair.endPoints[0]; + QTcpSocket *incoming = socketPair.endPoints[1]; + + QVERIFY(incoming->state() == QTcpSocket::ConnectedState); + QVERIFY(outgoing->state() == QTcpSocket::ConnectedState); + + outgoing->write("abc"); + QVERIFY(outgoing->waitForBytesWritten(2000)); + QVERIFY(incoming->waitForReadyRead(2000)); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc")); + + outgoing->write("def"); + QVERIFY(outgoing->waitForBytesWritten(2000)); + QVERIFY(incoming->waitForReadyRead(2000)); + QVERIFY(incoming->peek(128*1024) == QByteArray("abcdef")); + + outgoing->write("ghi"); + QVERIFY(outgoing->waitForBytesWritten(2000)); + QVERIFY(incoming->waitForReadyRead(2000)); + QVERIFY(incoming->peek(128*1024) == QByteArray("abcdefghi")); + + QVERIFY(incoming->read(128*1024) == QByteArray("abcdefghi")); +} + + QTEST_MAIN(tst_QTcpSocket) #include "tst_qtcpsocket.moc" -- cgit v0.12 From ccd3f663c8c96e266b173a6f825bccec830007e1 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 6 Oct 2010 10:31:06 +0200 Subject: Fix crash when constructing QThreadStorage after global destructors have run In this particular case, the destructors vector used by QThreadStorageData has already been destroyed, yet a new QThreadStorage is being allocated. This can only happen during global destruction, at which point we assume that there is only one thread. In order to keep QThreadStorage working, we need somewhere to store the data, and the best place we have in this situation is at the tail of the current thread's tls vector. The destructor is ignored, since we have no where to store it, and no way to actually call it. Task-number: QTBUG-10084 Reviewed-by: thiago Reviewed-by: olivier --- src/corelib/thread/qthreadstorage.cpp | 21 +++++++- tests/auto/qthreadstorage/crashOnExit.cpp | 64 ++++++++++++++++++++++++ tests/auto/qthreadstorage/crashOnExit.pro | 4 ++ tests/auto/qthreadstorage/qthreadstorage.pro | 8 +-- tests/auto/qthreadstorage/tst_qthreadstorage.cpp | 9 ++++ tests/auto/qthreadstorage/tst_qthreadstorage.pro | 4 ++ 6 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 tests/auto/qthreadstorage/crashOnExit.cpp create mode 100644 tests/auto/qthreadstorage/crashOnExit.pro create mode 100644 tests/auto/qthreadstorage/tst_qthreadstorage.pro diff --git a/src/corelib/thread/qthreadstorage.cpp b/src/corelib/thread/qthreadstorage.cpp index 88d73cc..2fc04f5 100644 --- a/src/corelib/thread/qthreadstorage.cpp +++ b/src/corelib/thread/qthreadstorage.cpp @@ -79,6 +79,21 @@ QThreadStorageData::QThreadStorageData(void (*func)(void *)) { QMutexLocker locker(mutex()); DestructorMap *destr = destructors(); + if (!destr) { + /* + the destructors vector has already been destroyed, yet a new + QThreadStorage is being allocated. this can only happen during global + destruction, at which point we assume that there is only one thread. + in order to keep QThreadStorage working, we need somewhere to store + the data, best place we have in this situation is at the tail of the + current thread's tls vector. the destructor is ignored, since we have + no where to store it, and no way to actually call it. + */ + QThreadData *data = QThreadData::current(); + id = data->tls.count(); + DEBUG_MSG("QThreadStorageData: Allocated id %d, destructor %p cannot be stored", id, func); + return; + } for (id = 0; id < destr->count(); id++) { if (destr->at(id) == 0) break; @@ -139,13 +154,15 @@ void **QThreadStorageData::set(void *p) data->thread); QMutexLocker locker(mutex()); - void (*destructor)(void *) = destructors()->value(id); + DestructorMap *destr = destructors(); + void (*destructor)(void *) = destr ? destr->value(id) : 0; locker.unlock(); void *q = value; value = 0; - destructor(q); + if (destructor) + destructor(q); } // store new data diff --git a/tests/auto/qthreadstorage/crashOnExit.cpp b/tests/auto/qthreadstorage/crashOnExit.cpp new file mode 100644 index 0000000..96515a0 --- /dev/null +++ b/tests/auto/qthreadstorage/crashOnExit.cpp @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +class Class +{ +public: + ~Class() + { + // trigger creation of a new QThreadStorage, after the previous QThreadStorage from main() was destructed + static QThreadStorage threadstorage; + threadstorage.setLocalData(new int); + threadstorage.setLocalData(new int); + } +}; + +int main() +{ + // instantiate the class that will use QThreadStorage from its destructor, it's destructor will be run last + static Class instance; + // instantiate QThreadStorage, it's destructor (and the global destructors for QThreadStorages internals) will run first + static QThreadStorage threadstorage; + threadstorage.setLocalData(new int); + threadstorage.setLocalData(new int); +} diff --git a/tests/auto/qthreadstorage/crashOnExit.pro b/tests/auto/qthreadstorage/crashOnExit.pro new file mode 100644 index 0000000..918ef39 --- /dev/null +++ b/tests/auto/qthreadstorage/crashOnExit.pro @@ -0,0 +1,4 @@ +SOURCES += crashOnExit.cpp +QT = core +CONFIG-=app_bundle +CONFIG+=console diff --git a/tests/auto/qthreadstorage/qthreadstorage.pro b/tests/auto/qthreadstorage/qthreadstorage.pro index 3071098..a06f89c 100644 --- a/tests/auto/qthreadstorage/qthreadstorage.pro +++ b/tests/auto/qthreadstorage/qthreadstorage.pro @@ -1,4 +1,4 @@ -load(qttest_p4) -SOURCES += tst_qthreadstorage.cpp -QT = core -symbian:LIBS += -llibpthread +TEMPLATE = subdirs +SUBDIRS = \ + tst_qthreadstorage.pro \ + crashOnExit.pro diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp index d8b404f..097d729 100644 --- a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp @@ -76,6 +76,7 @@ private slots: void autoDelete(); void adoptedThreads(); void ensureCleanupOrder(); + void QTBUG13877_crashOnExit(); }; class Pointer @@ -293,5 +294,13 @@ void tst_QThreadStorage::ensureCleanupOrder() QVERIFY(First::order < Second::order); } +void tst_QThreadStorage::QTBUG13877_crashOnExit() +{ + QProcess process; + process.start("./crashOnExit"); + QVERIFY(process.waitForFinished()); + QVERIFY(process.exitStatus() != QProcess::CrashExit); +} + QTEST_MAIN(tst_QThreadStorage) #include "tst_qthreadstorage.moc" diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.pro b/tests/auto/qthreadstorage/tst_qthreadstorage.pro new file mode 100644 index 0000000..3071098 --- /dev/null +++ b/tests/auto/qthreadstorage/tst_qthreadstorage.pro @@ -0,0 +1,4 @@ +load(qttest_p4) +SOURCES += tst_qthreadstorage.cpp +QT = core +symbian:LIBS += -llibpthread -- cgit v0.12 From 83b4cad278e2c3b0ca16affc76a82ddce9d6149a Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 6 Oct 2010 13:46:15 +0200 Subject: tst_qtcpserver: Another attempt to reproduce QTBUG-14268 The test (un)fortunately passes :-) Task-number: QTBUG-14268 --- tests/auto/qtcpserver/tst_qtcpserver.cpp | 53 ++++++++++++++++++++++++++++++++ tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 15 ++++----- 2 files changed, 61 insertions(+), 7 deletions(-) diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp index b2151b9..ab2a32d 100644 --- a/tests/auto/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp @@ -105,6 +105,8 @@ private slots: void invalidProxy(); void proxyFactory_data(); void proxyFactory(); + + void qtbug14268_peek(); }; // Testing get/set functions @@ -662,5 +664,56 @@ void tst_QTcpServer::proxyFactory() QTEST(int(server.serverError()), "expectedError"); } +class Qtbug14268Helper : public QObject +{ + Q_OBJECT +public: + QByteArray lastDataPeeked; +public slots: + void newConnection() { + QTcpServer* server=static_cast(sender()); + QTcpSocket* s=server->nextPendingConnection(); + connect(s,SIGNAL(readyRead()),this,SLOT(onServerReadyRead())); + } + void onServerReadyRead() { + QTcpSocket* clientSocket=static_cast(sender()); + lastDataPeeked = clientSocket->peek(128*1024).toHex(); + QTestEventLoop::instance().exitLoop(); + } +}; + +// there is a similar test inside tst_qtcpsocket that uses the waitFor* functions instead +void tst_QTcpServer::qtbug14268_peek() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + QTcpServer server; + server.listen(); + + Qtbug14268Helper helper; + QObject::connect(&server, SIGNAL(newConnection()), &helper, SLOT(newConnection())); + + QTcpSocket client; + client.connectToHost(QHostAddress::LocalHost, server.serverPort()); + QVERIFY(client.waitForConnected(2000)); + + client.write("abc\n"); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(helper.lastDataPeeked == QByteArray("6162630a")); + + client.write("def\n"); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a")); + + client.write("ghi\n"); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a6768690a")); +} + QTEST_MAIN(tst_QTcpServer) #include "tst_qtcpserver.moc" diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 5b77006..2dbe5b7 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -2505,6 +2505,7 @@ void tst_QTcpSocket::proxyFactory() delete socket; } +// there is a similar test inside tst_qtcpserver that uses the event loop instead void tst_QTcpSocket::qtbug14268_peek() { QFETCH_GLOBAL(bool, setProxy); @@ -2519,22 +2520,22 @@ void tst_QTcpSocket::qtbug14268_peek() QVERIFY(incoming->state() == QTcpSocket::ConnectedState); QVERIFY(outgoing->state() == QTcpSocket::ConnectedState); - outgoing->write("abc"); + outgoing->write("abc\n"); QVERIFY(outgoing->waitForBytesWritten(2000)); QVERIFY(incoming->waitForReadyRead(2000)); - QVERIFY(incoming->peek(128*1024) == QByteArray("abc")); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc\n")); - outgoing->write("def"); + outgoing->write("def\n"); QVERIFY(outgoing->waitForBytesWritten(2000)); QVERIFY(incoming->waitForReadyRead(2000)); - QVERIFY(incoming->peek(128*1024) == QByteArray("abcdef")); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\n")); - outgoing->write("ghi"); + outgoing->write("ghi\n"); QVERIFY(outgoing->waitForBytesWritten(2000)); QVERIFY(incoming->waitForReadyRead(2000)); - QVERIFY(incoming->peek(128*1024) == QByteArray("abcdefghi")); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\nghi\n")); - QVERIFY(incoming->read(128*1024) == QByteArray("abcdefghi")); + QVERIFY(incoming->read(128*1024) == QByteArray("abc\ndef\nghi\n")); } -- cgit v0.12 From eae8c143428128a4bea4c06cff93b38189da267d Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 7 Oct 2010 08:49:30 +0200 Subject: Fix failure on Windows after commit ccd3f66 By default the builds are placed in either a release\ or debug\ directory, so we need to start the correct one on Windows. Reviewed-by: trustme --- tests/auto/qthreadstorage/tst_qthreadstorage.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp index 097d729..ed86165 100644 --- a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp @@ -297,7 +297,15 @@ void tst_QThreadStorage::ensureCleanupOrder() void tst_QThreadStorage::QTBUG13877_crashOnExit() { QProcess process; +#ifdef Q_OS_WIN +# ifdef QT_NO_DEBUG + process.start("release/crashOnExit"); +# else + process.start("debug/crashOnExit"); +# endif +#else process.start("./crashOnExit"); +#endif QVERIFY(process.waitForFinished()); QVERIFY(process.exitStatus() != QProcess::CrashExit); } -- cgit v0.12