static QHash<const QMetaObject *, int> attachedPropertyIds;
};
-// Avoid multiple fromUtf8(), copies and hashing of the module name.
-// This is only called when metaTypeDataLock is locked.
-static QHashedString moduleFromUtf8(const char *module)
-{
- if (!module)
- return QHashedString();
-
- static const char *lastModule = 0;
- static QHashedString lastModuleStr;
-
- // Separate plugins may have different strings at the same address
- QHashedCStringRef currentModule(module, ::strlen(module));
- if ((lastModule != module) || (lastModuleStr.hash() != currentModule.hash())) {
- lastModuleStr = QString::fromUtf8(module);
- lastModuleStr.hash();
- lastModule = module;
- }
-
- return lastModuleStr;
-}
-
void QQmlType::SingletonInstanceInfo::init(QQmlEngine *e)
{
QV4::ExecutionEngine *v4 = QV8Engine::getV4(e->handle());
: d(new QQmlTypePrivate(SingletonType))
{
d->elementName = elementName;
- d->module = moduleFromUtf8(type.uri);
+ d->module = QString::fromUtf8(type.uri);
d->version_maj = type.versionMajor;
d->version_min = type.versionMinor;
: d(new QQmlTypePrivate(CppType))
{
d->elementName = elementName;
- d->module = moduleFromUtf8(type.uri);
+ d->module = QString::fromUtf8(type.uri);
d->version_maj = type.versionMajor;
d->version_min = type.versionMinor;
d->index = index;
d->elementName = elementName;
- d->module = moduleFromUtf8(type.uri);
+ d->module = QString::fromUtf8(type.uri);
d->version_maj = type.versionMajor;
d->version_min = type.versionMinor;
}
if (uri && !typeName.isEmpty()) {
- QString nameSpace = moduleFromUtf8(uri);
+ QString nameSpace = QString::fromUtf8(uri);
if (!data->typeRegistrationNamespace.isEmpty()) {
// We can only install types into the registered namespace