| 123 | } |
| 124 | |
| 125 | void 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 | |
| 147 | void CommunityModuleInfo::progress(URL::DownloadTask* /*task*/, int64 /*bytesDownloaded*/, int64 /*totalLength*/) |
| 148 | { |
nothing calls this directly
no test coverage detected