From 67dd642ca7cd7f61ba5de83218a3933ffe12f10e Mon Sep 17 00:00:00 2001
From: Jerome Pasion <jerome.pasion@nokia.com>
Date: Wed, 19 Oct 2011 10:43:24 +0200
Subject: Doc: adding link to the Qt Quick Components for Symbian page.

Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
---
 doc/src/declarative/declarativeui.qdoc     |   1 +
 doc/src/mainpage.qdoc                      |   1 +
 doc/src/platforms/supported-platforms.qdoc |   5 ++
 doc/src/qt-webpages.qdoc                   | 118 +++++++++++++++++++++++++++++
 4 files changed, 125 insertions(+)

diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index d1d82d8..bddd05b 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -82,6 +82,7 @@ Qt applications.
 \section1 QML Add-Ons
 
 \list
+\o \l{Qt Quick Components for Symbian}{Qt Quick Components for Symbian} - a native component set for the Symbian^3 platform
 \o \l{QtWebKit QML Module}
 \o \l{http://doc.qt.nokia.com/qtmobility-1.1.0/qml-plugins.html}{Mobility QML Plugins}
 \endlist
diff --git a/doc/src/mainpage.qdoc b/doc/src/mainpage.qdoc
index 41818ee..6865f10 100644
--- a/doc/src/mainpage.qdoc
+++ b/doc/src/mainpage.qdoc
@@ -110,6 +110,7 @@ applications using layouts and Qt Quick interfaces with QML.
 \o \l{Qt Quick} - create UIs using QML
     \list
     \o \l{external: Developing Qt Quick Applications}{Creator's QML Design Mode} - design Qt Quick interfaces using Creator's design mode
+    \o \l{Qt Quick Components for Symbian}{Qt Quick Components for Symbian} - a native QML component set for the Symbian^3 platform
     \endlist
 \o \l{Widgets and Layouts} - primary elements for C++ based interfaces
     \list
diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc
index ba59c37..eee6555 100644
--- a/doc/src/platforms/supported-platforms.qdoc
+++ b/doc/src/platforms/supported-platforms.qdoc
@@ -465,6 +465,8 @@
         \o \l{Platform and Compiler Notes - Symbian}{Platform Notes - Symbian}
         - Platform specific notes.
         \o \l{Getting Started Guides}{Getting started}
+        \o \l{Qt Quick Components for Symbian}{Qt Quick Components for Symbian}
+        - provides a QML component set for the Symbian^3 platform
     \endlist
 
     \section1 Key Features for Symbian Development
@@ -481,6 +483,9 @@
     time and lines of code required for traditional UI styling with
     Qt Style Sheets.
 
+    The \l{Qt Quick Components for Symbian}{Qt Quick Components for Symbian}
+    provides a native QML component set.
+
     \section2 Graphics Features
 
     Qt for Symbian contains a powerful paint engine that provides
diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc
index 742de73..16bc665 100644
--- a/doc/src/qt-webpages.qdoc
+++ b/doc/src/qt-webpages.qdoc
@@ -318,3 +318,121 @@
     \title Qt Developer Days 2010
 */
 
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/qt_essentials_widget_edition_fundamentals_of_qt_part_2_hello_world_in_qtcre
+    \title Qt Essentials - Fundamentals of Qt part 1
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/qt_essentials_widget_edition_fundamentals_of_qt_part_1_your_first_qt_applic
+    \title Qt Essentials - Fundamentals of Qt part 2
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/qt_essentials_widget_edition_application_creation_part_1_mainwindows
+    \title Qt Essentials - Application Creation part 1
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/application_creation_part_2_settings_resources_and_application_deployment
+    \title Qt Essentials - Application Creation part 2
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/application_creation_part_3_translation_for_developers
+    \title Qt Essentials - Application Creation part 3
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/widgets_part_1_common_widgets
+    \title Qt Essentials - Widgets part 1
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/widgets_part_2_layout_management
+    \title Qt Essentials - Widgets part 2
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/widgets_part_3_guidelines_for_custom_widgets
+    \title Qt Essentials - Widgets part 3
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/graphics_view_part_1_using_graphicsview_classes
+    \title Qt Essentials - Graphics View part 1
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/graphics_view_part_2_transformations_and_coordinate_systems
+    \title Qt Essentials - Graphics View part 2
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/graphics_view_part_3_creating_custom_items
+    \title Qt Essentials - Graphics View part 3
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_1_model_view_concept
+    \title Qt Essentials - Model/View I part 1
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_2_showing_simple_data
+    \title Qt Essentials - Model/View I part 2
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_3_proxy_models
+    \title Qt Essentials - Model/View I part 3
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_4_custom_models
+    \title Qt Essentials - Model/View I part 4
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_1_editing_item_data
+    \title Qt Essentials - Model/View II part 1
+*/
+/*!
+    \externalpage
+    \title Qt Essentials - Model/View II part 2
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_3_data_widget_mapper
+    \title Qt Essentials - Model/View II part 3
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_4_custom_tree_model
+    \title Qt Essentials - Model/View II part 4
+*/
+/*!
+    \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_5_drag_and_drop
+    \title Qt Essentials - Model/View II part 5
+*/
+/*!
+    \externalpage http://qt.nokia.com/certification
+    \title Qt Certification
+*/
+/*!
+    \externalpage http://qt.nokia.com/developer/learning/certification/exams/preparation-prerequisites
+    \title Qt Certification Exam Preparation and Prerequisites
+*/
+
+/*!
+    \externalpage http://qt.nokia.com/developer/learning/online/training/materials
+    \title Download Qt training materials
+*/
+
+/*!
+    \externalpage http://qt.nokia.com/partners/qt-in-education/qt-in-education-course-material/
+    \title Qt in Education Course Material
+*/
+
+/*!
+    \externalpage http://developer.qt.nokia.com/
+    \title Qt Developer Network
+*/
+
+/*!
+    \externalpage http://developer.qt.nokia.com/wiki/Qt_Modules_Maturity_Level
+    \title Qt Modules' Maturity Levels - Modules List
+*/
+
+/*!
+    \externalpage http://labs.qt.nokia.com/2011/05/03/qt-modules-maturity-level/
+    \title Qt Modules' Maturity Level - Description
+*/
+
+/*!
+    \externalpage http://doc.qt.nokia.com/qtquick-components-symbian-latest/index.html
+    \title Qt Quick Components for Symbian
+*/
-- 
cgit v0.12


From 65c5f90299193d1ef658b9b17cab551e03fbe14a Mon Sep 17 00:00:00 2001
From: Sami Merila <sami.merila@nokia.com>
Date: Thu, 20 Oct 2011 16:46:12 +0300
Subject: Accepting predicted text using hardware keyboard replaces unwanted
 part

Current implementation of Symbian input context assumes that predicted
word replacement happens so that the original typed text is at the end
of the surrounded text. The logic fails, if to-be-predicted text is
in the middle of, or in the beginning of another, already accepted
word.

As a fix, input context need to store the original cursor position,
when reset() was called (this happens when word selection list
appears). Input context is already storing a copy of a preedit string
in this situation.

Then, when word replacement happens, this stored cursor position is
used instead of current cursor position (the native side might
temporarily move the cursor to the end when word selection list opens
or closes) to replace the typed word with one selected from suggested
word list.

Stored cursor position is dismissed immediately after used, or
if cached preedit string is dismissed.

Task-number: QTBUG-22147
Reviewed-by: Miikka Heikkinen
---
 src/gui/inputmethod/qcoefepinputcontext_p.h     |  1 +
 src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 37 +++++++++++++++++++++++--
 2 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 8c30838..cefae5e 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -162,6 +162,7 @@ private:
     QBasicTimer m_tempPreeditStringTimeout;
     bool m_hasTempPreeditString;
     QString m_cachedPreeditString;
+    int m_cachedCursorAndAnchorPosition;
 
     int m_splitViewResizeBy;
     Qt::WindowStates m_splitViewPreviousWindowStates;
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 79005ce..66ab4c8 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -115,6 +115,7 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
       m_formatRetriever(0),
       m_pointerHandler(0),
       m_hasTempPreeditString(false),
+      m_cachedCursorAndAnchorPosition(-1),
       m_splitViewResizeBy(0),
       m_splitViewPreviousWindowStates(Qt::WindowNoState)
 {
@@ -158,9 +159,18 @@ void QCoeFepInputContext::reset()
     }
     // Store a copy of preedit text, if prediction is active and input context is reseted.
     // This is to ensure that we can replace preedit string after losing focus to FEP manager's
-    // internal sub-windows.
-    if (m_cachedPreeditString.isEmpty() && !(currentHints & Qt::ImhNoPredictiveText))
+    // internal sub-windows. Additionally, store the cursor position if there is no selected text.
+    // This allows input context to replace preedit strings if they are not at the end of current
+    // text.
+    if (m_cachedPreeditString.isEmpty() && !(currentHints & Qt::ImhNoPredictiveText)) {
         m_cachedPreeditString = m_preeditString;
+        if (focusWidget()) {
+            int cursor = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
+            int anchor = focusWidget()->inputMethodQuery(Qt::ImAnchorPosition).toInt();
+            if (cursor == anchor)
+                m_cachedCursorAndAnchorPosition = cursor;
+        }
+    }
     commitCurrentString(true);
 }
 
@@ -196,6 +206,7 @@ void QCoeFepInputContext::setFocusWidget(QWidget *w)
 void QCoeFepInputContext::widgetDestroyed(QWidget *w)
 {
     m_cachedPreeditString.clear();
+    m_cachedCursorAndAnchorPosition = -1;
 
     // Make sure that the input capabilities of whatever new widget got focused are queried.
     CCoeControl *ctrl = w->effectiveWinId();
@@ -981,6 +992,7 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText,
         return;
 
     m_cachedPreeditString.clear();
+    m_cachedCursorAndAnchorPosition = -1;
 
     commitTemporaryPreeditString();
 
@@ -1039,8 +1051,16 @@ void QCoeFepInputContext::UpdateFepInlineTextL(const TDesC& aNewInlineText,
     QString newPreeditString = qt_TDesC2QString(aNewInlineText);
     QInputMethodEvent event(newPreeditString, attributes);
     if (!m_cachedPreeditString.isEmpty()) {
-        event.setCommitString(QLatin1String(""), -m_cachedPreeditString.length(), m_cachedPreeditString.length());
+        int cursorPos = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
+        // Predicted word is either replaced from the end of the word (normal case),
+        // or from stored location, if the predicted word is either in the beginning of,
+        // or in the middle of already committed word.
+        int diff = cursorPos - m_cachedCursorAndAnchorPosition;
+        int replaceLocation = (diff != m_cachedPreeditString.length()) ? diff : m_cachedPreeditString.length();
+
+        event.setCommitString(QLatin1String(""), -replaceLocation, m_cachedPreeditString.length());
         m_cachedPreeditString.clear();
+        m_cachedCursorAndAnchorPosition = -1;
     } else if (newPreeditString.isEmpty() && m_preeditString.isEmpty()) {
         // In Symbian world this means "erase last character".
         event.setCommitString(QLatin1String(""), -1, 1);
@@ -1138,6 +1158,10 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur
 
     int pos = aCursorSelection.iAnchorPos;
     int length = aCursorSelection.iCursorPos - pos;
+    if (m_cachedCursorAndAnchorPosition != -1) {
+        pos = m_cachedCursorAndAnchorPosition;
+        length = 0;
+    }
 
     QList<QInputMethodEvent::Attribute> attributes;
     attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos, length, QVariant());
@@ -1155,6 +1179,13 @@ void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSele
 
     int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size();
     int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size();
+
+    // If the position is stored, use that value, so that word replacement from proposed word
+    // lists are added to the correct position.
+    if (m_cachedCursorAndAnchorPosition != -1) {
+        cursor = m_cachedCursorAndAnchorPosition;
+        anchor = m_cachedCursorAndAnchorPosition;
+    }
     QString text = w->inputMethodQuery(Qt::ImSurroundingText).value<QString>();
     int combinedSize = text.size() + m_preeditString.size();
     if (combinedSize < anchor || combinedSize < cursor) {
-- 
cgit v0.12


From e2b892c48c986c38f431b1af98023d16af53bc96 Mon Sep 17 00:00:00 2001
From: Casper van Donderen <casper.vandonderen@nokia.com>
Date: Fri, 21 Oct 2011 12:14:58 +0200
Subject: Fix security problem on webpage due to bad JS

Reviewed-by: Trust Me
---
 doc/src/template/scripts/functions.js                    | 13 +------------
 tools/qdoc3/doc/config/scripts/functions.js              | 13 +------------
 tools/qdoc3/test/qt-html-templates-online.qdocconf       | 13 -------------
 tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf | 11 -----------
 tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf | 11 -----------
 5 files changed, 2 insertions(+), 59 deletions(-)

diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js
index 3ab4a08..af204d8 100755
--- a/doc/src/template/scripts/functions.js
+++ b/doc/src/template/scripts/functions.js
@@ -183,17 +183,6 @@ var blankRE=/^\s*$/;
 
 function CheckEmptyAndLoadList()
 {
-	/* Start Extracting information for feedback and adding this to the feedback form */
-	var pageUrl = window.location.pathname;
-	var pageVal = $('title').html();
-	$('#pageType').removeClass('red');
-	$('#feedUrl').remove();
-	$('#pageVal').remove();
-	$('.menuAlert').remove();
-	$('#feedform').append('<input id="feedUrl" name="feedUrl" value="'+pageUrl+'" style="display:none;">');
-	$('#feedform').append('<input id="pageVal" name="pageVal" value="'+pageVal+'" style="display:none;">');
-	/* 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*/
@@ -255,4 +244,4 @@ function CheckEmptyAndLoadList()
               });
             }, 500); /* timer set to 500 ms */
         });
-      }); 
\ No newline at end of file
+      }); 
diff --git a/tools/qdoc3/doc/config/scripts/functions.js b/tools/qdoc3/doc/config/scripts/functions.js
index 62bc535..af204d8 100755
--- a/tools/qdoc3/doc/config/scripts/functions.js
+++ b/tools/qdoc3/doc/config/scripts/functions.js
@@ -183,17 +183,6 @@ 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();
-	$('#pageType').removeClass('red');
-	$('#feedUrl').remove();
-	$('#pageVal').remove();
-	$('.menuAlert').remove();
-	$('#feedform').append('<input id="feedUrl" name="feedUrl" value="'+pageUrl+'" style="display:none;">');
-	$('#feedform').append('<input id="pageVal" name="pageVal" value="'+pageVal+'" style="display:none;">');
-	/* 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*/
@@ -255,4 +244,4 @@ function CheckEmptyAndLoadList()
               });
             }, 500); /* timer set to 500 ms */
         });
-      }); 
\ No newline at end of file
+      }); 
diff --git a/tools/qdoc3/test/qt-html-templates-online.qdocconf b/tools/qdoc3/test/qt-html-templates-online.qdocconf
index 77ab3c5..af78088 100644
--- a/tools/qdoc3/test/qt-html-templates-online.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates-online.qdocconf
@@ -142,8 +142,6 @@ HTML.postpostheader = \
     "        <div class=\"content mainContent\">\n"
 
 HTML.footer = \
-    "        <div class=\"feedback t_button\">\n" \
-    "          [+] Documentation Feedback</div>\n" \
     "      </div>\n" \
     "    </div>\n" \
     "    </div> \n" \
@@ -169,17 +167,6 @@ HTML.footer = \
     "      Free Documentation License version 1.3</a>\n" \
     "      as published by the Free Software Foundation.</p>\n" \
     "  </div>\n" \
-    "  <div id=\"feedbackBox\">\n" \
-    "      <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
-    "    <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
-    "      <p id=\"noteHead\">Thank you for giving your feedback.</p> <p class=\"note\">Make sure it is related to this specific page. For more general bugs and \n" \
-    "      requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a>.</p>\n" \
-    "      <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\"></textarea></p>\n" \
-    "      <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
-    "    </form>\n" \
-    "  </div>\n" \
-    "  <div id=\"blurpage\">\n" \
-    "  </div>\n" \
     "\n" \
     "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n" \
     "  <script type=\"text/javascript\">\n" \
diff --git a/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf b/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf
index fa15d90..80d6dd7 100644
--- a/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates_ja_JP-online.qdocconf
@@ -139,8 +139,6 @@ HTML.postpostheader = \
 
 HTML.footer = \
     "        <!-- /div -->\n" \
-    "        <div class=\"feedback t_button\">\n" \
-    "          [+] Documentation Feedback</div>\n" \
     "      </div>\n" \
     "    </div>\n" \
     "    <div class=\"ft\">\n" \
@@ -164,13 +162,4 @@ HTML.footer = \
     "      Alternatively, this document may be used under the terms of the <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU\n" \
     "      Free Documentation License version 1.3</a>\n" \
     "      as published by the Free Software Foundation.</p>\n" \
-    "  </div>\n" \
-    "  <div id=\"feedbackBox\">\n" \
-    "      <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
-    "    <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
-    "      <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\">Please submit your feedback...</textarea></p>\n" \
-    "      <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
-    "    </form>\n" \
-    "  </div>\n" \
-    "  <div id=\"blurpage\">\n" \
     "  </div>\n"
diff --git a/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf b/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf
index 285ec27..02f444d 100644
--- a/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates_zh_CN-online.qdocconf
@@ -139,8 +139,6 @@ HTML.postpostheader = \
 
 HTML.footer = \
     "        <!-- /div -->\n" \
-    "        <div class=\"feedback t_button\">\n" \
-    "          [+] Documentation Feedback</div>\n" \
     "      </div>\n" \
     "    </div>\n" \
     "    <div class=\"ft\">\n" \
@@ -164,13 +162,4 @@ HTML.footer = \
     "      Alternatively, this document may be used under the terms of the <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU\n" \
     "      Free Documentation License version 1.3</a>\n" \
     "      as published by the Free Software Foundation.</p>\n" \
-    "  </div>\n" \
-    "  <div id=\"feedbackBox\">\n" \
-    "      <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
-    "    <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
-    "      <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\">Please submit your feedback...</textarea></p>\n" \
-    "      <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
-    "    </form>\n" \
-    "  </div>\n" \
-    "  <div id=\"blurpage\">\n" \
     "  </div>\n"
-- 
cgit v0.12


From cc084a1a05c53035bf401aed2e08e3c30a75e509 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Thu, 27 Oct 2011 15:22:45 +1000
Subject: Adding items to a view with no delegate crashes.

If there is no delegate then clear state and return.

Change-Id: I786b9bc4018706797056fbd1ad25d25663102707
Task-number: QTBUG-22379
Reviewed-by: Andrew den Exter
---
 src/declarative/graphicsitems/qdeclarativegridview.cpp | 10 ++++++++++
 src/declarative/graphicsitems/qdeclarativelistview.cpp | 15 +++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 29c714d..feca6b5 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2852,6 +2852,11 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
             addedVisible = true;
         }
         FxGridItem *item = d->createItem(modelIndex + i);
+        if (!item) {
+            // broken or no delegate
+            d->clear();
+            return;
+        }
         d->visibleItems.insert(index, item);
         item->setPosition(colPos, rowPos);
         added.append(item);
@@ -3042,6 +3047,11 @@ void QDeclarativeGridView::itemsMoved(int from, int to, int count)
             FxGridItem *movedItem = moved.take(item->index);
             if (!movedItem)
                 movedItem = d->createItem(item->index);
+            if (!movedItem) {
+                // broken or no delegate
+                d->clear();
+                return;
+            }
             it = d->visibleItems.insert(it, movedItem);
             if (it == d->visibleItems.begin() && firstItem)
                 movedItem->setPosition(firstItem->colPos(), firstItem->rowPos());
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 920b6ae..37c34dc 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -3283,6 +3283,11 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
                 addedVisible = true;
             }
             FxListItem *item = d->createItem(modelIndex + i);
+            if (!item) {
+                // broken or no delegate
+                d->clear();
+                return;
+            }
             d->visibleItems.insert(insertionIdx, item);
             pos -= item->size() + d->spacing;
             item->setPosition(pos);
@@ -3313,6 +3318,11 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
                 addedVisible = true;
             }
             FxListItem *item = d->createItem(modelIndex + i);
+            if (!item) {
+                // broken or no delegate
+                d->clear();
+                return;
+            }
             d->visibleItems.insert(index, item);
             item->setPosition(pos);
             added.append(item);
@@ -3516,6 +3526,11 @@ void QDeclarativeListView::itemsMoved(int from, int to, int count)
             FxListItem *movedItem = moved.take(item->index);
             if (!movedItem)
                 movedItem = d->createItem(item->index);
+            if (!movedItem) {
+                // broken or no delegate
+                d->clear();
+                return;
+            }
             if (item->index <= firstVisible->index)
                 moveBy -= movedItem->size();
             it = d->visibleItems.insert(it, movedItem);
-- 
cgit v0.12


From 080fb267e54cd17697d0a7dbe00449c17d461a11 Mon Sep 17 00:00:00 2001
From: Shane Kearns <shane.kearns@accenture.com>
Date: Fri, 28 Oct 2011 11:20:07 +0100
Subject: Symbian - disable memory mapping in QNetworkDiskCache

The implementation of memory mapped files in Open C requires
munmap to be called from the same thread as mmap. As the
QIODevice can be handed off to another thread, this breaks
application code that works on other operating systems.

Task-number: QT-5309
Reviewed-by: Tadaaki Matsumoto
---
 src/network/access/qnetworkdiskcache.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index 3b18fe8..9d91a8f 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -404,7 +404,7 @@ QIODevice *QNetworkDiskCache::data(const QUrl &url)
             // ### verify that QFile uses the fd size and not the file name
             qint64 size = file->size() - file->pos();
             const uchar *p = 0;
-#ifndef Q_OS_WINCE
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
             p = file->map(file->pos(), size);
 #endif
             if (p) {
-- 
cgit v0.12