MCPcopy Create free account
hub / github.com/commontk/CTK / getPluginResource

Method getPluginResource

Libs/PluginFramework/ctkPluginStorageSQL.cpp:816–836  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

814
815//----------------------------------------------------------------------------
816QByteArray ctkPluginStorageSQL::getPluginResource(int key, const QString& res) const
817{
818 QSqlDatabase database = getConnection();
819 QSqlQuery query(database);
820
821 QString statement = "SELECT Resource FROM PluginResources WHERE K=? AND ResourcePath=?";
822
823 QString resourcePath = res.startsWith('/') ? res : QString("/") + res;
824 QList<QVariant> bindValues;
825 bindValues.append(key);
826 bindValues.append(resourcePath);
827
828 executeQuery(&query, statement, bindValues);
829
830 if (query.next())
831 {
832 return query.value(EBindIndex).toByteArray();
833 }
834
835 return QByteArray();
836}
837
838//----------------------------------------------------------------------------
839void ctkPluginStorageSQL::createTables()

Callers 1

getResourceMethod · 0.45

Calls 2

QStringClass · 0.50
valueMethod · 0.45

Tested by

no test coverage detected