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
*/
6
#include "
KoFontChangeTracker.h
"
7
8
#include <QFileSystemWatcher>
9
#include <
kis_signal_compressor.h
>
10
#include <QDebug>
11
12
struct
KoFontChangeTracker::Private
{
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
24
KoFontChangeTracker::KoFontChangeTracker
(
QStringList
paths, QObject *parent)
25
: QObject(parent)
26
, d(new
Private
(paths))
27
{
28
connect
(&
d
->fileSystemWatcher, SIGNAL(directoryChanged(QString)), SLOT(
directoriesChanged
(QString)));
29
}
30
31
KoFontChangeTracker::~KoFontChangeTracker
()
32
{
33
}
34
35
void
KoFontChangeTracker::resetChangeTracker
()
36
{
37
d
->filesChanged =
false
;
38
}
39
40
41
void
KoFontChangeTracker::directoriesChanged
(QString path)
42
{
43
if
(!
d
->filesChanged) {
44
d
->filesChanged =
true
;
45
emit (
sigUpdateConfig
());
46
}
47
}
QStringList
QList< QString > QStringList
Definition
KisQStringListFwd.h:18
KoFontChangeTracker.h
connect
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KoFontChangeTracker::resetChangeTracker
void resetChangeTracker()
This should be called after fontregistry initialization is done to start the signal compressor.
Definition
KoFontChangeTracker.cpp:35
KoFontChangeTracker::KoFontChangeTracker
KoFontChangeTracker(QStringList paths, QObject *parent=nullptr)
Definition
KoFontChangeTracker.cpp:24
KoFontChangeTracker::d
QScopedPointer< Private > d
Definition
KoFontChangeTracker.h:31
KoFontChangeTracker::sigUpdateConfig
void sigUpdateConfig()
KoFontChangeTracker::directoriesChanged
void directoriesChanged(QString path)
Definition
KoFontChangeTracker.cpp:41
KoFontChangeTracker::~KoFontChangeTracker
~KoFontChangeTracker()
Definition
KoFontChangeTracker.cpp:31
QList< QString >
kis_signal_compressor.h
Private
Definition
SvgTransformParser.cpp:20
KoFontChangeTracker::Private
Definition
KoFontChangeTracker.cpp:12
KoFontChangeTracker::Private::configStale
bool configStale
Definition
KoFontChangeTracker.cpp:21
KoFontChangeTracker::Private::filesChanged
bool filesChanged
Definition
KoFontChangeTracker.cpp:20
KoFontChangeTracker::Private::Private
Private(QStringList paths=QStringList(), int refresh=500)
Definition
KoFontChangeTracker.cpp:14
KoFontChangeTracker::Private::fileSystemWatcher
QFileSystemWatcher fileSystemWatcher
Definition
KoFontChangeTracker.cpp:18
libs
flake
text
KoFontChangeTracker.cpp
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52