summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcontext.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-27 04:05:26 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-27 04:05:26 (GMT)
commit2af9bc37a5955e8e1da2c3ba03fa0be763e2ae5e (patch)
tree778e6e7341a4a6b159a3716e6255179d0a229db0 /src/declarative/qml/qmlcontext.cpp
parent1a862af842db0196313ab7819b607763fd0d87db (diff)
downloadQt-2af9bc37a5955e8e1da2c3ba03fa0be763e2ae5e.zip
Qt-2af9bc37a5955e8e1da2c3ba03fa0be763e2ae5e.tar.gz
Qt-2af9bc37a5955e8e1da2c3ba03fa0be763e2ae5e.tar.bz2
Simplify the defaultObjects handling
As the scope object is no longer added to the defaultObjects list it makes sense that the root object remain constant at position 0
Diffstat (limited to 'src/declarative/qml/qmlcontext.cpp')
-rw-r--r--src/declarative/qml/qmlcontext.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index 7ba3544..2ebdf10 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -50,9 +50,6 @@
#include <private/qmlbindingoptimizations_p.h>
#include <QtDeclarative/qmlinfo.h>
-// 6-bits
-#define MAXIMUM_DEFAULT_OBJECTS 63
-
QT_BEGIN_NAMESPACE
QmlContextPrivate::QmlContextPrivate()
@@ -130,22 +127,6 @@ void QmlContextPrivate::init()
parent->d_func()->childContexts.insert(q);
}
-void QmlContextPrivate::addDefaultObject(QObject *object, Priority priority)
-{
- if (defaultObjects.count() >= (MAXIMUM_DEFAULT_OBJECTS - 1)) {
- qWarning("QmlContext: Cannot have more than %d default objects on "
- "one bind context.", MAXIMUM_DEFAULT_OBJECTS - 1);
- return;
- }
-
- if (priority == HighPriority) {
- defaultObjects.insert(highPriorityCount++, object);
- } else {
- defaultObjects.append(object);
- }
-}
-
-
/*!
\class QmlContext
\brief The QmlContext class defines a context within a QML engine.
@@ -366,7 +347,7 @@ QmlContext *QmlContext::parentContext() const
void QmlContext::addDefaultObject(QObject *defaultObject)
{
Q_D(QmlContext);
- d->addDefaultObject(defaultObject, QmlContextPrivate::NormalPriority);
+ d->defaultObjects.prepend(defaultObject);
}
/*!