aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmllocale.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert qml locale object to new data layoutLars Knoll2014-07-221-22/+22
| | | | | Change-Id: I1c02498102d89be1127fb6bbf0b38e21c48bed8b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix remaining QQmlLocale auto-test failuresSimon Hausmann2014-04-081-2/+5
| | | | | | | | | | | | | | | | Thanks to improvements in QDateTime's parser, we can unskip a bunch of tests. What remained was dateFromLocaleTimeString, which failed because it relied on the earlier behavior of a failed conversion from a _time_ string to a date also returning an invalid date object. This behavior is restored by leaving the QDateTime object as invalid unless the converted time is valid. In Qt <= 5.1, QDateTime::setTime would make the entire datetime object invalid if the provided time was invalid. In Qt >= 5.2 it remains potentially valid if the date at least is correct - which was the case here as it was initialized from currentDateTime. Change-Id: I32a2cd2a9631cca3b12773e4c55169baa3eeaf1a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-02-111-3/+6
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4context.cpp Change-Id: Ied5b23bec4dc14abe51127c507aed668f855c1e1
| * Updated documentation for QML Locale.measurementSystemAnders Gunnarsson2014-02-071-3/+6
| | | | | | | | | | | | | | Added documentation for ImperialUSSystem and ImperialUKSystem. Change-Id: I1a628121dce4a7566bd8769843c487e28f3dd6fe Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Change virtual methods in ArrayData to take Object pointerLars Knoll2014-01-241-2/+2
| | | | | | | | | | | | | | | | | | Pass a pointer to the underlying object instead of the ArrayData to virtual methods that modify the arrayData. This prepares for allocating the ArrayData together with the array itself. Change-Id: I66fe187f8b1e4d382ab243a518dbde5f18a1d16d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Split ManagedVTable into two classesLars Knoll2014-01-211-1/+1
| | | | | | | | | | | | | | | | Keep the basic methods in ManagedVTable, but have the Object related stuff in an ObjectVTable class. Change-Id: I9b068acf3caef813686227b8d935e7df1a7d1a6e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add a SimpleArrayData classLars Knoll2014-01-201-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the ArrayData class 'pure virtual'. SimpleArrayData now contains the implementation of simple arrays. This makes the separation between simple and sparse arrays a lot cleaner. It also allows us to move len and offset from the base class into the SimpleArrayClass. This fixes some bugs where we accessed len for sparse arrays leading to some buggy behavior. Added a virtual length() method to ArrayData to query the highes used index in the Array. Change-Id: Iab2ba2a48ebe5b7031759eeb4ebe02b4d86233f0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Allow assignment of a QML Locale object to a C++ QLocale property.Mitch Curtis2014-01-141-63/+14
| | | | | | | | | | | | | | Task-number: QTBUG-36125 Change-Id: I58454db0c47684aed3e95c52a8135fd5fd6bf2f9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Rework array handling for JS objectsLars Knoll2014-01-091-4/+5
| | | | | | | | | | | | | | | | | | Split up ArrayData into two classes, one for regular arrays, one for sparse arrays and cleanly separate the two cases. Only create array data on demand. Change-Id: I9ca8d0b53592174f213ba0f20caf93e77dba690a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move array data into it's own structLars Knoll2014-01-031-4/+4
| | | | | | | | | | | | | | First step of separating the array data from Object. Change-Id: I5c857397f0ef53cff0807debdb1e405424e1046a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move Managed::type and some flags into the vtableLars Knoll2014-01-031-1/+0
|/ | | | | | | | | | | | | Move the type flag into the vtable to free up these bits in the Managed class, and not have to set them at object construction time. As we often need to know whether a Managed object is a Object, FunctionObject or String, add some bitflags to test for these to the vtable. Change-Id: I7d08ca044544debb307b55f124f34cb086ad9e84 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove setVTable calls in performance critical areasLars Knoll2013-12-041-1/+1
| | | | | | | | | | Remove all the calls to setVTable that were in performance critical parts of the code. This now brings performance back to the level we had with the vtable inlined in the Managed objects. Change-Id: I76317cc5c53b5b700d1d3883b954407142a4c424 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the vtable pointer from the object to the internal classLars Knoll2013-12-041-1/+1
| | | | | | | | This saves one pointer per object, and willmake other optimizations easier in the future. Change-Id: I1324cad31998896b5dc76af3c8a7ee9d86283bfe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Simplify & speed up function callingLars Knoll2013-11-091-49/+49
| | | | | | | | | Get rid of the SimpleCallContext, instead simply use the CallContext data structure, but don't initialize the unused variables. Change-Id: I11b311986da180c62c815b516a2c55844156d0ab Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Better way of handling string additionsLars Knoll2013-11-041-2/+2
| | | | | | | | | | | The old algorithm still had some quadratic behavior when adding strings in a loop. This fixes is by keeping track of the longest substring used, as well as the length of the string. If the length is larger then twice the length of the longest substring, we simplify the string. Change-Id: I9d99ae1632a8046ac135e67bdbb448638d15836d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Avoid side effects when en exception has been thrown.Lars Knoll2013-10-291-25/+51
| | | | | | | | | | | | | | We don't want to check for exceptions after every single line on our runtime methods. A better way to handle this is to add the check in all methods that have direct side effects (as e.g. writing to a property of the JS stack). We also need to return whereever we throw an exception. To simplify the code, ExecutionContext::throwXxx methods now return a ReturnedValue (always undefined) for convenience. Change-Id: Ide6c804f819c731a3f14c6c43121d08029c9fb90 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-27/+27
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove most uses of Value from qml/qmlLars Knoll2013-09-301-2/+2
| | | | | Change-Id: I409a8505a9e01f86d777bc694d24516d1c8f0c4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove Value::fromString()Lars Knoll2013-09-281-16/+16
| | | | | | | | replaced with call to the GC safe ExceutionEngine::newString() method. Change-Id: I7258296e75ca724ff42b94a0d147bc33a05f8f68 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-281-1/+1
| | | | | | | | This will simplify finding the remaining direct usages of QV4::Value that need fixing. Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix CallContext to not hold arguments on the C stack anymoreLars Knoll2013-09-281-106/+106
| | | | | Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Updated imports, \qmlmodule, and \inqmlmodule versions in src/qml.Jerome Pasion2013-09-271-1/+1
| | | | | | | | | | | | -QDoc ignores the version in \inqmlmodule so its better to remove them to avoid confusion. -Qt QML import version is 2.2 for 5.2 release -Qt Quick import version is 2.2 for 5.2 release Task-number: QTBUG-32172 Change-Id: I15df270f1fb4df0476a9ddd854fb9ddf58e9fc7c Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix Persistent/WeakValue APILars Knoll2013-09-261-3/+5
| | | | | | | Don't use unprotected Values in the API anymore. Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix cases where mark() would access uninitialized memoryLars Knoll2013-09-221-2/+4
| | | | | Change-Id: I4e07e20d30ba57759a0ece1c298a02b098718b33 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup Object::define*Property APILars Knoll2013-09-221-36/+36
| | | | | Change-Id: I99125908a9bc1d41a2642c409af9704def7a0832 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Further work towards an exact GCLars Knoll2013-09-221-3/+23
| | | | | | | | | | | Add some more convenience in the helper classes in qscopedvalue_p.h Make accesses to CallData safer, and change ExecutionEngine::newObject() to return a safe pointer. Change-Id: I980909754ce9681cf6faa1355bab3a1e5d6dd186 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge branch 'stable' into devSergio Ahumada2013-09-191-29/+29
|\ | | | | | | | | | | | | | | Conflicts: src/qml/qml/v8/qqmlbuiltinfunctions.cpp tests/auto/qml/qml.pro Change-Id: Ib373aed6a8f8df9521740fb5b080daed38546cd2
| * Doc: Move properties of Locale QML type to correct moduleTopi Reinio2013-09-171-29/+29
| | | | | | | | | | | | | | | | | | Moves property and method documentation for QML Locale type from Qt Quick to Qt Qml module, and fix a number of broken links in locale-related docs. Change-Id: Id9e01314ea867987f5159ca3bffcc40abb27b289 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Convert more methods to return a Returned<>Lars Knoll2013-09-181-4/+6
| | | | | | | | | | Change-Id: If294c9c4f574824c308b63a11da1337226180105 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert a few more methods in ExecutionEngine to use protected pointersLars Knoll2013-09-181-6/+6
| | | | | | | | | | Change-Id: I2e6b1b9dff52bbd16f35a00152c9ac557f8346eb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert most remaining return values from Value to ReturnedValueLars Knoll2013-09-181-2/+2
| | | | | | | | | | Change-Id: If8b0c3b91be50678693868c10fefc3678008834d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert builtin methods to return a ReturnedValueLars Knoll2013-09-181-89/+89
| | | | | | | | | | Change-Id: I6b75adbf53a5be0deab023d2eed98ce2a7915551 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Use a ReturnedValue when converting to String or ObjectLars Knoll2013-09-121-6/+6
| | | | | | | | | | | | | | | | Also rename Value::toQString() to Value::toQStringNoThrow(), and add a throwing toQString() method for JS use. Change-Id: I821b33fc61abb7d08839df965fd337685f61a545 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup calls to Object::setPrototype()Lars Knoll2013-09-021-6/+6
| | | | | | | | | | | | | | | | Rather use the correct internalClass directly when constructing the objects. Change-Id: I8e916f1ce8f83d291c08ca6332fe85b1f57b90b5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move prototype pointer into QV4::InternalClassLars Knoll2013-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The prototype is actually the same for most objects. By moving it into the internal class, we can save 8 bytes per object, as well as allowing for some future optimizations. Also fix a bug in the implementation of the Error prototype objects. Change-Id: I4d4b641055f644a9b088f27be34bfdb0446279b7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix compilation with MSVC 2008 (and prospective Windows CE build fix)Simon Hausmann2013-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Only 2010 and newer ship stdint.h, so for 2008 we have to provide a little stdint.h compat header, for some of the third-party code we import. Our own Qt code this patch changes to use quint* types instead. * Include math.h and float.h for some math functions. * disable the JIT on Windows CE for now. * Change use of intptr_t to qintptr in Qt code. intptr_t is in inttypes.h, except that with VS 2008 it is indirectly available through stdio.h. Let's avoid the mess and just use the qt type, that's always available. Change-Id: I19055edd89e0a6b147d9edbb3b711798ed3c05a5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix qqmlecmascript::sequenceConversionThreads with aggressive GCSimon Hausmann2013-07-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | During the deserialization of a sequence, make sure that when the collector runs during the filling of the array, that partially filled array is marked properly. Fixed setting of arrayDataLen in other similar places as well. Change-Id: I19926f733c7c7d1398b11b48c1c37f43e7099ead Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-06-241-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
| * Doc: Define Qt global object as a QML type and fix referring docsTopi Reinio2013-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | This change adds the Qt global object as a QML type in the Qt QML module and fixes links to it in documentation. Task-number: QTBUG-29353 Change-Id: I1690224091a79a3309fac7a78aa0c0c734449e4f Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Doc: Qt Quick: Fix module name format (Pt 2/2)Sze Howe Koh2013-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Attempt to differentiate between the whole module ("Qt Quick") and the QML import ("QtQuick") by encoding the latter with monospace font. There are places in the text where both representations are valid. Change-Id: If398304757e0a5106542c09099e1814084e54c5c Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Doc: Reassigned types and pages to their correct modules.Jerome Pasion2013-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 1)Moved classes and basic types to \module QtQml 2. -QQml* classes are in QtQml 2 for 5.1 2)Removed \inqmlmodule commands in overviews and tutorials. -Only QML API should have \inqmlmodule commands because they are added to the auto generated list of types. Change-Id: I9aa3ca8062fa9fed76734885829879122841b119 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Fix the first half of qqmllocale auto testsLars Knoll2013-06-181-2/+3
| | | | | | | | | | Change-Id: I0f37208eaefcb668d3b61d294129134cfaa7c8f4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Stop using v4classgen for QQmlLocaleSimon Hausmann2013-06-131-8/+29
| | | | | | | | | | | | | | It's easy enough now to just define the properties by hand. Change-Id: I6a053bf22f606280d21e9985928d7c69252611d4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Convert more subclasses of Managed to the new casting schemeLars Knoll2013-05-311-10/+5
| | | | | | | | | | Change-Id: I4105f61d8b1d32b59281eb28fc31002a0ac4e4eb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove template argument from MemberAccessorGetterSetter classLars Knoll2013-05-261-31/+48
| | | | | | | | | | | | | | | | | | Like this we don't need to have the call method inline. This is bad, as the method uses try/catch, and leads to compile errors with clang if the header is included from libs compiled without exceptions enabled. Change-Id: I801e21aafafc255836dfa19b81c84f884de0b395 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove some unused classes from the v8 APILars Knoll2013-05-211-1/+2
| | | | | | | | | | Change-Id: I6fdb7903a3cdb3b3167144f78bd7cf58647deb67 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove unused engine pointer in QQmlLocaleDataSimon Hausmann2013-05-101-2/+0
| | | | | | | | | | | | | | As per the comment, this is unused now and can be removed :) Change-Id: I74e26ee46755c6c4fcfc09fa4062690852f8b6cf Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Port the of qml locale getters to V4 accessorsSimon Hausmann2013-05-091-69/+50
| | | | | | | | | | | | | | | | | | Added support for getters/setters to the class generator as well as a simple help template for calling the member function getters. Change-Id: I3bb287a53d9f249837fa2c513d4886873476ad95 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Ported over a few more locale functionsSimon Hausmann2013-05-091-24/+15
| | | | | | | | | | | | | | This code is becoming much simpler :) Change-Id: Icd31bedd13f4a8fce145992b2a7706594ac809bf Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Begin implement C++ style wrappers in QQmlLocaleSimon Hausmann2013-05-091-7/+16
| | | | | | | | | | | | | | | | | | The locale.currencySymbol function is converted into a member function of the wrapper. For the time of the transition the prototype chain is modified to be obj -> v8 proto template -> v4classgen generated proto Change-Id: I72913e9d284a2a3678b23c7d7ce27fbb3447f1fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>