status_t AMRExtractor::getMetaData(MetaDataBase &meta) { meta.clear(); if (mInitCheck == OK) { meta.setCString(kKeyMIMEType, mIsWide ? "audio/amr-wb" : "audio/amr"); } return OK; }
QDESIGNER_SHARED_EXPORT bool setPropertyComment(QDesignerFormEditorInterface* core, QObject *o, const QString &propertyName, const QString &value) { MetaDataBase *db = qobject_cast<MetaDataBase *>(core->metaDataBase()); if (!db) return false; MetaDataBaseItem *item = db->metaDataBaseItem(o); if (!item) return false; item->setPropertyComment(propertyName, value); return true; }
QDESIGNER_SHARED_EXPORT void demoteWidget(QDesignerFormEditorInterface *core,QWidget *widget) { MetaDataBase *db = qobject_cast<MetaDataBase *>(core->metaDataBase()); if (!db) return; MetaDataBaseItem *item = db->metaDataBaseItem(widget); item->setCustomClassName(QString()); if (debugMetaDatabase) { qDebug() << "Demoting " << widget; } }
void ScriptCommand::undo() { MetaDataBase *metaDataBase = qobject_cast<MetaDataBase*>(formWindow()->core()->metaDataBase()); Q_ASSERT(metaDataBase); ObjectScriptList::const_iterator cend = m_oldValues.constEnd(); for (ObjectScriptList::const_iterator it = m_oldValues.constBegin();it != cend; ++it ) { if (it->first) metaDataBase->metaDataBaseItem(it->first)->setScript(it->second); } }
bool ScriptCommand::init(const ObjectList &list, const QString &script) { MetaDataBase *metaDataBase = qobject_cast<MetaDataBase*>(formWindow()->core()->metaDataBase()); if (!metaDataBase) return false; // Save old values m_oldValues.clear(); foreach (QObject *obj, list) { const MetaDataBaseItem* item = metaDataBase->metaDataBaseItem(obj); if (!item) return false; m_oldValues.push_back(ObjectScriptPair(obj, item->script())); } m_script = script; return true; }
// promotion convenience QDESIGNER_SHARED_EXPORT bool promoteWidget(QDesignerFormEditorInterface *core,QWidget *widget,const QString &customClassName) { MetaDataBase *db = qobject_cast<MetaDataBase *>(core->metaDataBase()); if (!db) return false; MetaDataBaseItem *item = db->metaDataBaseItem(widget); if (!item) { db ->add(widget); item = db->metaDataBaseItem(widget); } // Recursive promotion occurs if there is a plugin missing. const QString oldCustomClassName = item->customClassName(); if (!oldCustomClassName.isEmpty()) { qDebug() << "WARNING: Recursive promotion of " << oldCustomClassName << " to " << customClassName << ". A plugin is missing."; } item->setCustomClassName(customClassName); if (debugMetaDatabase) { qDebug() << "Promoting " << widget->metaObject()->className() << " to " << customClassName; } return true; }