Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1021 B
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2024 Wolthera van Hövell tot Westerflier <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */
#include "KoFontChangeTracker.h"

#include <QFileSystemWatcher>
#include <kis_signal_compressor.h>
#include <QDebug>

struct KoFontChangeTracker::Private {

    Private(QStringList paths = QStringList())
        : fileSystemWatcher(paths) {

    }
    QFileSystemWatcher fileSystemWatcher;

    bool filesChanged = false;
    bool configStale = false;
};

KoFontChangeTracker::KoFontChangeTracker(QStringList paths, QObject *parent)
    : QObject(parent)
    , d(new Private(paths))
{
    connect(&d->fileSystemWatcher, SIGNAL(directoryChanged(QString)), SLOT(directoriesChanged()));
}

KoFontChangeTracker::~KoFontChangeTracker()
{
}

void KoFontChangeTracker::resetChangeTracker()
{
    d->filesChanged = false;
}


void KoFontChangeTracker::directoriesChanged()
{
    if (!d->filesChanged) {
        d->filesChanged = true;
        emit (sigUpdateConfig());
    }
}