| 236 | |
| 237 | |
| 238 | bool FvUpdater::CheckForUpdates(bool silentAsMuchAsItCouldGet) |
| 239 | { |
| 240 | if (m_feedURL.isEmpty()) { |
| 241 | qCritical() << "Please set feed URL via setFeedURL() before calling CheckForUpdates()."; |
| 242 | return false; |
| 243 | } |
| 244 | |
| 245 | m_silentAsMuchAsItCouldGet = silentAsMuchAsItCouldGet; |
| 246 | |
| 247 | // Check if application's organization name and domain are set, fail otherwise |
| 248 | // (nowhere to store QSettings to) |
| 249 | if (QApplication::organizationName().isEmpty()) { |
| 250 | qCritical() << "QApplication::organizationName is not set. Please do that."; |
| 251 | return false; |
| 252 | } |
| 253 | if (QApplication::organizationDomain().isEmpty()) { |
| 254 | qCritical() << "QApplication::organizationDomain is not set. Please do that."; |
| 255 | return false; |
| 256 | } |
| 257 | |
| 258 | // Set application name / version is not set yet |
| 259 | if (QApplication::applicationName().isEmpty()) { |
| 260 | QString appName = QString::fromUtf8(FV_APP_NAME); |
| 261 | qWarning() << "QApplication::applicationName is not set, setting it to '" << appName << "'"; |
| 262 | QApplication::setApplicationName(appName); |
| 263 | } |
| 264 | if (QApplication::applicationVersion().isEmpty()) { |
| 265 | QString appVersion = QString::fromUtf8(FV_APP_VERSION); |
| 266 | qWarning() << "QApplication::applicationVersion is not set, setting it to '" << appVersion << "'"; |
| 267 | QApplication::setApplicationVersion(appVersion); |
| 268 | } |
| 269 | |
| 270 | cancelDownloadFeed(); |
| 271 | m_httpRequestAborted = false; |
| 272 | startDownloadFeed(m_feedURL); |
| 273 | |
| 274 | return true; |
| 275 | } |
| 276 | |
| 277 | bool FvUpdater::CheckForUpdatesSilent() |
| 278 | { |
nothing calls this directly
no outgoing calls
no test coverage detected