2023-04-11 10:19:35 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright (C) 2023, KylinSoft Co., Ltd.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2022-06-18 10:46:14 +08:00
|
|
|
#ifndef MOUNTDISKLISTENER_H
|
|
|
|
#define MOUNTDISKLISTENER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2022-10-21 11:21:35 +08:00
|
|
|
#include <QDBusInterface>
|
|
|
|
#include <QDBusReply>
|
2022-06-18 10:46:14 +08:00
|
|
|
|
|
|
|
class DirWatcher : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static DirWatcher *getDirWatcher();
|
2022-10-21 11:21:35 +08:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void initDbusService();
|
|
|
|
|
|
|
|
QStringList currentIndexableDir();
|
2022-06-18 10:46:14 +08:00
|
|
|
QStringList currentBlackListOfIndex();
|
|
|
|
|
|
|
|
QStringList currentSearchableDir();
|
|
|
|
QStringList searchableDirForSearchApplication();
|
|
|
|
QStringList blackListOfDir(const QString &dirPath);
|
|
|
|
|
2023-05-06 09:19:50 +08:00
|
|
|
QStringList getBlockDirsOfUser();
|
|
|
|
|
2023-04-08 16:54:01 +08:00
|
|
|
void appendSearchDir(const QString &path);
|
|
|
|
void removeSearchDir(const QString &path);
|
2022-10-21 11:21:35 +08:00
|
|
|
void appendIndexableListItem(const QString &path);
|
|
|
|
void removeIndexableListItem(const QString &path);
|
|
|
|
void sendAppendSignal(const QString &path, const QStringList &blockList);
|
|
|
|
void sendRemoveSignal(const QString&path);
|
|
|
|
Q_SIGNALS:
|
|
|
|
void appendIndexItem(const QString&, const QStringList&);
|
|
|
|
void removeIndexItem(const QString&);
|
2022-06-18 10:46:14 +08:00
|
|
|
private:
|
|
|
|
DirWatcher(QObject *parent = nullptr);
|
|
|
|
~DirWatcher();
|
|
|
|
|
2022-10-21 11:21:35 +08:00
|
|
|
QDBusInterface *m_dbusInterface = nullptr;
|
2022-06-18 10:46:14 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MOUNTDISKLISTENER_H
|
|
|
|
|