void Updates::gotUpdatesInfo(const QHttpResponseHeader &responseHeader) { Q_UNUSED(responseHeader) kdebugf(); QByteArray data = HttpClient->readAll(); if (config_file.readBoolEntry("General", "CheckUpdates")) { unsigned int size = data.size(); if (size > 31) { kdebugmf(KDEBUG_WARNING, "cannot obtain update info\n"); deleteLater(); return; } QString newestVersion(data); if (isNewerVersion(newestVersion)) { UpdatesDialog *dialog = new UpdatesDialog(newestVersion, Core::instance()->kaduWindow()); dialog->show(); } } config_file.writeEntry("General", "LastUpdateCheck", QDateTime(QDate(1970, 1, 1)).secsTo(QDateTime::currentDateTime())); deleteLater(); }
void Updates::gotUpdatesInfo(QNetworkReply *reply) { kdebugf(); reply->deleteLater(); deleteLater(); if (Application::instance()->configuration()->deprecatedApi()->readBoolEntry("General", "CheckUpdates")) { auto newestVersion = QString::fromUtf8(reply->readAll()); if (newestVersion.size() > 31) { kdebugmf(KDEBUG_WARNING, "cannot obtain update info\n"); return; } if (isNewerVersionThan(newestVersion)) { UpdatesDialog *dialog = new UpdatesDialog(newestVersion, Core::instance()->kaduWindow()); dialog->show(); } } }