Changeset 57334 in webkit


Ignore:
Timestamp:
Apr 9, 2010 6:03:43 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-09 Tasuku Suzuki <tasuku.suzuki@nokia.com>

Reviewed by Simon Hausmann.

[Qt]Fix compile error with QT_NO_PROPERTIES
https://bugs.webkit.org/show_bug.cgi?id=36526

Disable dynamic properties when QT_NO_PROPERTIES is defined.

  • bridge/qt/qt_class.cpp: (JSC::Bindings::QtClass::fieldNamed):
  • bridge/qt/qt_instance.cpp: (JSC::Bindings::QtInstance::getPropertyNames): (JSC::Bindings::QtField::name): (JSC::Bindings::QtField::valueFromInstance): (JSC::Bindings::QtField::setValueToInstance):
  • bridge/qt/qt_runtime.h: (JSC::Bindings::QtField::):
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57333 r57334  
     12010-04-09  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt]Fix compile error with QT_NO_PROPERTIES
     6        https://bugs.webkit.org/show_bug.cgi?id=36526
     7
     8        Disable dynamic properties when QT_NO_PROPERTIES is defined.
     9
     10        * bridge/qt/qt_class.cpp:
     11        (JSC::Bindings::QtClass::fieldNamed):
     12        * bridge/qt/qt_instance.cpp:
     13        (JSC::Bindings::QtInstance::getPropertyNames):
     14        (JSC::Bindings::QtField::name):
     15        (JSC::Bindings::QtField::valueFromInstance):
     16        (JSC::Bindings::QtField::setValueToInstance):
     17        * bridge/qt/qt_runtime.h:
     18        (JSC::Bindings::QtField::):
     19
    1202010-04-09  David Leong  <david.leong@nokia.com>
    221
  • trunk/WebCore/bridge/qt/qt_class.cpp

    r55837 r57334  
    140140            if (f->fieldType() == QtField::MetaProperty)
    141141                return f;
     142#ifndef QT_NO_PROPERTIES
    142143            else if (f->fieldType() == QtField::DynamicProperty) {
    143144                if (obj->dynamicPropertyNames().indexOf(ba) >= 0)
     
    148149                    delete f;
    149150                }
    150             } else {
     151            }
     152#endif
     153            else {
    151154                QList<QObject*> children = obj->children();
    152155                for (int index = 0; index < children.count(); ++index) {
     
    173176        }
    174177
     178#ifndef QT_NO_PROPERTIES
    175179        // Dynamic properties
    176180        index = obj->dynamicPropertyNames().indexOf(ba);
     
    180184            return f;
    181185        }
     186#endif
    182187
    183188        // Child objects
     
    203208            return 0;
    204209
     210#ifndef QT_NO_PROPERTIES
    205211        // deleted qobject, but can't throw an error from here (no exec)
    206212        // create a fake QtField that will throw upon access
     
    209215            qtinst->m_fields.insert(objName, f);
    210216        }
     217#endif
    211218        return f;
    212219    }
  • trunk/WebCore/bridge/qt/qt_instance.cpp

    r55312 r57334  
    221221        }
    222222
     223#ifndef QT_NO_PROPERTIES
    223224        QList<QByteArray> dynProps = obj->dynamicPropertyNames();
    224225        foreach(QByteArray ba, dynProps) {
    225226            array.add(Identifier(exec, ba.constData()));
    226227        }
     228#endif
    227229
    228230        for (i=0; i < meta->methodCount(); i++) {
     
    326328    else if (m_type == ChildObject && m_childObject)
    327329        return m_childObject->objectName().toLatin1();
     330#ifndef QT_NO_PROPERTIES
    328331    else if (m_type == DynamicProperty)
    329332        return m_dynamicProperty.constData();
     333#endif
    330334    return ""; // deleted child object
    331335}
     
    345349        } else if (m_type == ChildObject)
    346350            val = QVariant::fromValue((QObject*) m_childObject);
     351#ifndef QT_NO_PROPERTIES
    347352        else if (m_type == DynamicProperty)
    348353            val = obj->property(m_dynamicProperty);
    349 
     354#endif
    350355        return convertQVariantToValue(exec, inst->rootObject(), val);
    351356    } else {
     
    372377            if (m_property.isWritable())
    373378                m_property.write(obj, val);
    374         } else if (m_type == DynamicProperty)
     379        }
     380#ifndef QT_NO_PROPERTIES
     381        else if (m_type == DynamicProperty)
    375382            obj->setProperty(m_dynamicProperty.constData(), val);
     383#endif
    376384    } else {
    377385        QString msg = QString(QLatin1String("cannot access member `%1' of deleted QObject")).arg(QLatin1String(name()));
  • trunk/WebCore/bridge/qt/qt_runtime.h

    r55404 r57334  
    4141    typedef enum {
    4242        MetaProperty,
     43#ifndef QT_NO_PROPERTIES
    4344        DynamicProperty,
     45#endif
    4446        ChildObject
    4547    } QtFieldType;
     
    4951        {}
    5052
     53#ifndef QT_NO_PROPERTIES
    5154    QtField(const QByteArray &b)
    5255        : m_type(DynamicProperty), m_dynamicProperty(b)
    5356        {}
     57#endif
    5458
    5559    QtField(QObject *child)
Note: See TracChangeset for help on using the changeset viewer.