MCPcopy Create free account
hub / github.com/Atarity/Lightpack / readUpdates

Method readUpdates

Software/src/UpdatesProcessor.cpp:55–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55QList<UpdateInfo> UpdatesProcessor::readUpdates(uint lastReadId)
56{
57 QList<UpdateInfo> updates;
58
59 QXmlStreamReader xmlReader(_reply->readAll());
60
61 if (xmlReader.readNextStartElement()) {
62 if (xmlReader.name() == "updates") {
63 readUpdates(&updates, &xmlReader);
64 QList<UpdateInfo>::iterator it = updates.begin();
65 while (it != updates.end()) {
66 UpdateInfo updateInfo = *it;
67 if (!updateInfo.softwareVersion.isEmpty() && !isVersionMatches(updateInfo.softwareVersion, &kCurVersion)) {
68 updates.removeAll(updateInfo);
69 } else if (updateInfo.id <= lastReadId) {
70 updates.removeAll(updateInfo);
71 } else {
72 it++;
73 }
74 }
75 }
76 }
77
78 return updates;
79}
80
81bool UpdatesProcessor::isVersionMatches(const QString &predicate, const AppVersion *version)
82{

Callers 2

Calls 2

nameMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected