----------------------------------------------------------------------------
| 814 | |
| 815 | //---------------------------------------------------------------------------- |
| 816 | QByteArray 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 | //---------------------------------------------------------------------------- |
| 839 | void ctkPluginStorageSQL::createTables() |
no test coverage detected