MCPcopy Create free account
hub / github.com/benkuper/Chataigne / finished

Method finished

Source/Module/Community/CommunityModuleInfo.cpp:125–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void CommunityModuleInfo::finished(URL::DownloadTask* task, bool success)
126{
127 if (!success)
128 {
129 LOGERROR("Error while downloading " + url + ",\ntry downloading it directly from the website.\nError code : " + String(task->statusCode()));
130 return;
131 }
132
133 File moduleFile = getDownloadFilePath();
134 File modulesDir = ModuleManager::getInstance()->factory->getCustomModulesFolder();
135
136 if (localModuleFolder.exists()) localModuleFolder.deleteRecursively();
137
138 ZipFile zip(moduleFile);
139 zip.uncompressTo(modulesDir);
140
141 ModuleManager::getInstance()->factory->updateCustomModules();
142 localModuleFolder = ModuleManager::getInstance()->factory->getFolderForCustomModule(niceName);
143
144 updateLocalData();
145}
146
147void CommunityModuleInfo::progress(URL::DownloadTask* /*task*/, int64 /*bytesDownloaded*/, int64 /*totalLength*/)
148{

Callers

nothing calls this directly

Calls 3

updateCustomModulesMethod · 0.80

Tested by

no test coverage detected