| 2074 | } |
| 2075 | |
| 2076 | void MainWindow::checkForUpdates(bool silent) |
| 2077 | { |
| 2078 | #ifdef Q_OS_WIN |
| 2079 | qInfo(Q_FUNC_INFO); |
| 2080 | |
| 2081 | QString url = "https://github.com/dail8859/NotepadNext/raw/master/updates.json"; |
| 2082 | QSimpleUpdater::getInstance()->checkForUpdates(url); |
| 2083 | |
| 2084 | if (!silent) { |
| 2085 | connect(QSimpleUpdater::getInstance(), &QSimpleUpdater::checkingFinished, this, &MainWindow::checkForUpdatesFinished, Qt::UniqueConnection); |
| 2086 | } |
| 2087 | else { |
| 2088 | disconnect(QSimpleUpdater::getInstance(), &QSimpleUpdater::checkingFinished, this, &MainWindow::checkForUpdatesFinished); |
| 2089 | } |
| 2090 | |
| 2091 | |
| 2092 | app->getSettings()->setValue("App/LastUpdateCheck", QDateTime::currentDateTime()); |
| 2093 | #else |
| 2094 | Q_UNUSED(silent); |
| 2095 | #endif |
| 2096 | } |
| 2097 | |
| 2098 | void MainWindow::checkForUpdatesFinished(QString url) |
| 2099 | { |
nothing calls this directly
no test coverage detected