本文整理汇总了C++中PluginInterface::getAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginInterface::getAttributeValue方法的具体用法?C++ PluginInterface::getAttributeValue怎么用?C++ PluginInterface::getAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginInterface
的用法示例。
在下文中一共展示了PluginInterface::getAttributeValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkAndSaveFile
bool Filter::checkAndSaveFile(QString path) {
bool saved = false;
// does the file rely under the watched directory?
if (!path.startsWith(m_dir))
return saved;
// if any plugin accepts the file, then save its ref
// in the db
for (int i = 0; !saved && i < m_plugins.count(); i++) {
m_plugins[i]->loadAttributes(path);
saved |= m_plugins[i]->checkFile(path);
}
// save file if retained
if (saved) {
QString fileId = m_db.addFile(m_filterId, path); // add file to db
// signal
newFile(m_virtualDirectoryPath, path);
// save file attributes
for (int i = 0; i < m_plugins.count(); i++) {
PluginInterface *fP = m_plugins[i];
fP->loadAttributes(path); // attributes are loaded only if not done in the above checkFile iteration, we don't reload attrs if same file...
QList<QString>attributes = fP->getAttributeNames();
for (QList<QString>::iterator j = attributes.begin(); j != attributes.end(); j++) {
QString attrName = (*j);
QVariant attrObjValue = fP->getAttributeValue(attrName);
QString attrValue = attrObjValue.isValid() ? attrObjValue.toString() : "<null>";
m_db.addFileAttribute(fileId, attrName, attrValue);
}
}
}
return saved;
}