MCPcopy Create free account
hub / github.com/IENT/YUView / getFilesToUpdate

Method getFilesToUpdate

YUViewLib/src/handler/UpdateHandlerFile.cpp:131–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131QList<downloadFile> updateFileHandler::getFilesToUpdate(updateFileHandler &localFiles) const
132{
133 QList<downloadFile> updateList;
134 for (auto remoteFile : this->updateFileList)
135 {
136 bool fileFound = false;
137 bool updateNeeded = false;
138 for(auto localFile : localFiles.updateFileList)
139 {
140 if (localFile.filePath.toLower() == remoteFile.filePath.toLower())
141 {
142 // File found. Do we need to update it?
143 updateNeeded = (localFile.version != remoteFile.version) || (localFile.hash != remoteFile.hash);
144 fileFound = true;
145 break;
146 }
147 }
148 if (!fileFound || updateNeeded)
149 updateList.append(downloadFile(remoteFile.filePath, remoteFile.fileSize));
150 }
151 // No matter what, we will update the "versioninfo.txt" file (assume it to be 10kbyte)
152 updateList.append(downloadFile(UPDATEFILEHANDLER_FILE_NAME, 10000));
153 return updateList;
154}
155
156QString updateFileHandler::getInfo() const
157{

Callers 1

replyFinishedMethod · 0.80

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected