1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef CMAKEITEMKEEPER_H
6#define CMAKEITEMKEEPER_H
7
8#include "common/common.h"
9
10#include <QObject>
11#include <QStandardItem>
12
13class CmakeItemKeeperPrivate;
14class CmakeItemKeeper : public Inotify
15{
16 Q_OBJECT
17 Q_DISABLE_COPY(CmakeItemKeeper)
18 CmakeItemKeeper();
19 CmakeItemKeeperPrivate *const d;
20
21public:
22 static CmakeItemKeeper *instance();
23 virtual ~CmakeItemKeeper();
24
25signals:
26 void cmakeFileNodeNotify(QStandardItem *rootItem, const QPair<QString, QStringList> &files);
27
28public slots:
29 void addCmakeRootFile(QStandardItem *root, const QString rootPath);
30 void addCmakeSubFiles(QStandardItem *root, const QStringList subPaths);
31 void delCmakeFileNode(QStandardItem *rootItem);
32
33private:
34 void notifyFromWatcher(const QString &filePath);
35};
36
37#endif // CMAKEITEMKEEPER_H
38