File indexing completed on 2025-02-02 05:17:48
0001 /* 0002 * SPDX-FileCopyrightText: 2023 Méven Car (meven@kde.org) 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <Plugin.h> 0010 #include <memory> 0011 0012 class KDirWatch; 0013 0014 class LibreOfficeEventSpyPlugin : public Plugin 0015 { 0016 Q_OBJECT 0017 0018 public: 0019 explicit LibreOfficeEventSpyPlugin(QObject *parent); 0020 ~LibreOfficeEventSpyPlugin() override; 0021 0022 bool init(QHash<QString, QObject *> &modules) override; 0023 0024 private Q_SLOTS: 0025 void fileUpdated(const QString &file); 0026 void addDocument(const QUrl &url, const QString &application, const QString &mimetype); 0027 0028 private: 0029 QObject *m_resources; 0030 std::unique_ptr<KDirWatch> m_dirWatcher; 0031 QUrl m_lastUrl; 0032 bool m_init = false; 0033 };