MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / setAutoSync

Method setAutoSync

src/common/settings/settings.cpp:320–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320void Settings::setAutoSync(bool autoSync)
321{
322 if (d->autoSync == autoSync)
323 return;
324
325 d->autoSync = autoSync;
326 if (autoSync) {
327 if (d->syncEnabled)
328 sync();
329
330 if (!d->syncTimer) {
331 d->syncTimer = new QTimer(this);
332 d->syncTimer->moveToThread(thread());
333 d->syncTimer->setSingleShot(true);
334 d->syncTimer->setInterval(1000);
335
336 connect(d->syncTimer, &QTimer::timeout, this, &Settings::sync);
337 }
338 } else {
339 if (d->syncTimer) {
340 d->syncTimer->stop();
341 d->syncTimer->deleteLater();
342 d->syncTimer = nullptr;
343 }
344 }
345}

Callers

nothing calls this directly

Calls 2

connectFunction · 0.85
stopMethod · 0.45

Tested by

no test coverage detected