MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / closeEvent

Method closeEvent

nixnote.cpp:1256–1288  ·  view source on GitHub ↗

Close the program

Source from the content-addressed store, hash-verified

1254//* Close the program
1255//*****************************************************************************
1256void 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

Callers

nothing calls this directly

Calls 3

valueMethod · 0.80
oauthTokenFoundMethod · 0.80
quitMethod · 0.80

Tested by

no test coverage detected