MCPcopy Create free account
hub / github.com/Skycoder42/QtAutoUpdater / prepareUpdate

Method prepareUpdate

tests/auto/plugins/WebQueryTest/tst_webquery.cpp:150–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150bool WebQueryTest::prepareUpdate(const QVersionNumber &version)
151{
152 if (_parser == QStringLiteral("version")) {
153 _server->setUpdateInfo(version > QVersionNumber::fromString(QCoreApplication::applicationVersion()) ?
154 version :
155 QVersionNumber{});
156 } else {
157 _server->setUpdateInfo(createInfos(QVersionNumber::fromString(QCoreApplication::applicationVersion()),
158 version));
159 }
160 QUrlQuery query;
161 if (_autoQuery) {
162 query.addQueryItem(QStringLiteral("name"), QCoreApplication::applicationName());
163 query.addQueryItem(QStringLiteral("version"), QCoreApplication::applicationVersion());
164 query.addQueryItem(QStringLiteral("domain"), QCoreApplication::organizationDomain());
165 query.addQueryItem(QStringLiteral("abi"), QSysInfo::buildAbi());
166 query.addQueryItem(QStringLiteral("kernel-type"), QSysInfo::kernelType());
167 query.addQueryItem(QStringLiteral("kernel-version"), QSysInfo::kernelVersion());
168 query.addQueryItem(QStringLiteral("os-type"), QSysInfo::productType());
169 query.addQueryItem(QStringLiteral("os-version"), QSysInfo::productVersion());
170 }
171 _server->setQuery(query);
172 return true;
173}
174
175bool WebQueryTest::canAbort(bool hard) const
176{

Callers

nothing calls this directly

Calls 2

setUpdateInfoMethod · 0.80
setQueryMethod · 0.80

Tested by

no test coverage detected