Close the program
| 1254 | //* Close the program |
| 1255 | //***************************************************************************** |
| 1256 | void NixNote::closeEvent(QCloseEvent *event) { |
| 1257 | // if (closeToTray && !closeFlag) { |
| 1258 | // event->ignore(); |
| 1259 | // hide(); |
| 1260 | // return; |
| 1261 | // } |
| 1262 | |
| 1263 | saveOnExit(); |
| 1264 | |
| 1265 | global.settings->beginGroup("Sync"); |
| 1266 | bool syncOnShutdown = global.settings->value("syncOnShutdown", false).toBool(); |
| 1267 | global.settings->endGroup(); |
| 1268 | if (syncOnShutdown && !finalSync && global.accountsManager->oauthTokenFound()) { |
| 1269 | finalSync = true; |
| 1270 | syncRunner.finalSync = true; |
| 1271 | hide(); |
| 1272 | connect(&syncRunner, SIGNAL(syncComplete()), this, SLOT(close())); |
| 1273 | synchronize(); |
| 1274 | event->ignore(); |
| 1275 | return; |
| 1276 | } |
| 1277 | |
| 1278 | syncRunner.keepRunning = false; |
| 1279 | syncThread.quit(); |
| 1280 | |
| 1281 | if (trayIcon->isVisible()) |
| 1282 | trayIcon->hide(); |
| 1283 | if (trayIcon != NULL) |
| 1284 | delete trayIcon; |
| 1285 | |
| 1286 | QMainWindow::closeEvent(event); |
| 1287 | QLOG_DEBUG() << "Quitting"; |
| 1288 | } |
| 1289 | |
| 1290 | |
| 1291 |
nothing calls this directly
no test coverage detected