* @brief Returns the Updater instance registered with the given @a url. * * If no Updater is registered with the given @a url, a new one is created and * configured automatically. */
| 488 | * configured automatically. |
| 489 | */ |
| 490 | Updater* QSimpleUpdater::getUpdater(const QString& url) const |
| 491 | { |
| 492 | if (!URLS.contains(url)) { |
| 493 | Updater* updater = new Updater; |
| 494 | updater->setUrl(url); |
| 495 | |
| 496 | URLS.append(url); |
| 497 | UPDATERS.append(updater); |
| 498 | |
| 499 | connect(updater, &Updater::checkingFinished, this, &QSimpleUpdater::checkingFinished); |
| 500 | connect(updater, &Updater::downloadFinished, this, &QSimpleUpdater::downloadFinished); |
| 501 | connect(updater, &Updater::appcastDownloaded, this, &QSimpleUpdater::appcastDownloaded); |
| 502 | } |
| 503 | |
| 504 | return UPDATERS.at(URLS.indexOf(url)); |
| 505 | } |
| 506 | |
| 507 | #if QSU_INCLUDE_MOC |
| 508 | # include "moc_QSimpleUpdater.cpp" |