MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / writeOFXCache

Method writeOFXCache

Engine/OfxHost.cpp:1087–1115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1085} // loadOFXPlugins
1086
1087void
1088OfxHost::writeOFXCache()
1089{
1090 /// and write a new cache, long version with everything in there
1091 QString ofxCachePath = getOFXCacheDirPath();
1092 QDir().mkpath(ofxCachePath);
1093 QString ofxCacheFilePath = getCacheFilePath();
1094
1095 QTemporaryFile tmpf;
1096 tmpf.open();
1097 QString tmpFileName = tmpf.fileName();
1098 tmpf.remove();
1099
1100 FStreamsSupport::ofstream ofile;
1101 FStreamsSupport::open( &ofile, tmpFileName.toStdString() );
1102 if (!ofile) {
1103 return;
1104 }
1105 OFX::Host::PluginCache* pluginCache = OFX::Host::PluginCache::getPluginCache();
1106 assert(pluginCache);
1107 pluginCache->writePluginCache(ofile);
1108
1109 ofile.close();
1110 if (QFile::exists(ofxCacheFilePath)) {
1111 QFile::remove(ofxCacheFilePath);
1112 }
1113 QFile::copy(tmpFileName, ofxCacheFilePath);
1114 QFile::remove(tmpFileName);
1115}
1116
1117void
1118OfxHost::clearPluginsLoadedCache()

Callers

nothing calls this directly

Calls 8

getOFXCacheDirPathFunction · 0.85
QDirClass · 0.85
getCacheFilePathFunction · 0.85
openFunction · 0.85
removeMethod · 0.80
toStdStringMethod · 0.80
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected