C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 11s
JS/TS / fmt (pull_request) Successful in 9s
JS/TS / lint (pull_request) Successful in 10s
Python / static (pull_request) Successful in 34s
Rust / build (pull_request) Successful in 59s
Python / verify (pull_request) Successful in 1m48s
Rust / fmt (pull_request) Successful in 47s
Rust / clippy (pull_request) Successful in 1m6s
26 lines
463 B
C++
26 lines
463 B
C++
#include "changebatcher.hpp"
|
|
|
|
namespace ZShell::settings {
|
|
|
|
ChangeBatcher::ChangeBatcher(QObject* parent)
|
|
: QObject(parent)
|
|
, m_dirty(false) {}
|
|
|
|
void ChangeBatcher::dirty() {
|
|
if (m_dirty)
|
|
return;
|
|
|
|
m_dirty = true;
|
|
QMetaObject::invokeMethod(this, &ChangeBatcher::flush, Qt::QueuedConnection);
|
|
}
|
|
|
|
void ChangeBatcher::flush() {
|
|
if (!m_dirty)
|
|
return;
|
|
|
|
m_dirty = false;
|
|
emit dirtied();
|
|
}
|
|
|
|
} // namespace ZShell::settings
|