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

Method insertPlugin

Libs/PluginFramework/ctkPluginStorageSQL.cpp:368–393  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

366
367//----------------------------------------------------------------------------
368QSharedPointer<ctkPluginArchive> ctkPluginStorageSQL::insertPlugin(const QUrl& location, const QString& localPath)
369{
370 QMutexLocker lock(&m_archivesLock);
371
372 QFileInfo fileInfo(localPath);
373 if (!fileInfo.exists())
374 {
375 throw ctkInvalidArgumentException(localPath + " does not exist");
376 }
377
378 const QString libTimestamp = getStringFromQDateTime(fileInfo.lastModified());
379
380 QSharedPointer<ctkPluginArchiveSQL> archive(new ctkPluginArchiveSQL(this, location, localPath,
381 m_nextFreeId++));
382 try
383 {
384 insertArchive(archive);
385 m_archives << archive;
386 return archive;
387 }
388 catch(...)
389 {
390 m_nextFreeId--;
391 throw;
392 }
393}
394
395//----------------------------------------------------------------------------
396void ctkPluginStorageSQL::insertArchive(QSharedPointer<ctkPluginArchiveSQL> pa)

Callers 1

installMethod · 0.80

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected