Krita Source Code Documentation
Loading...
Searching...
No Matches
KoFontChangeTracker.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
7
8#include <QFileSystemWatcher>
10#include <QDebug>
11
13
14 Private(QStringList paths = QStringList(), int refresh = 500)
15 : fileSystemWatcher(paths) {
16
17 }
18 QFileSystemWatcher fileSystemWatcher;
19
20 bool filesChanged = false;
21 bool configStale = false;
22};
23
25 : QObject(parent)
26 , d(new Private(paths))
27{
28 connect(&d->fileSystemWatcher, SIGNAL(directoryChanged(QString)), SLOT(directoriesChanged(QString)));
29}
30
34
36{
37 d->filesChanged = false;
38}
39
40
42{
43 if (!d->filesChanged) {
44 d->filesChanged = true;
45 emit (sigUpdateConfig());
46 }
47}
QList< QString > QStringList
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void resetChangeTracker()
This should be called after fontregistry initialization is done to start the signal compressor.
KoFontChangeTracker(QStringList paths, QObject *parent=nullptr)
QScopedPointer< Private > d
void directoriesChanged(QString path)
Private(QStringList paths=QStringList(), int refresh=500)