File indexing completed on 2025-01-26 05:00:55

0001 /*
0002  *   SPDX-FileCopyrightText: 2019 Méven Car (meven.car@kdemail.net)
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 RecentlyUsedEventSpyPlugin : public Plugin
0015 {
0016     Q_OBJECT
0017 
0018 public:
0019     explicit RecentlyUsedEventSpyPlugin(QObject *parent);
0020     ~RecentlyUsedEventSpyPlugin() 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     QDateTime m_lastUpdate;
0032 };