File: predicatesmonitor_p.h

package info (click to toggle)
plasma-workspace 4%3A6.3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 104,900 kB
  • sloc: cpp: 125,434; xml: 31,579; python: 3,976; perl: 572; sh: 234; javascript: 74; ruby: 39; ansic: 13; makefile: 9
file content (41 lines) | stat: -rw-r--r-- 889 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * SPDX-FileCopyrightText: 2024 Bohdan Onofriichuk <bogdan.onofriuchuk@gmail.com>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#pragma once

#include <Solid/Predicate>

/**
 * This class get predicates for a given path. Used by ActionControl to create default actions
 */

class KDirWatch;

class PredicatesMonitor : public QObject
{
    Q_OBJECT

public:
    static std::shared_ptr<PredicatesMonitor> instance();
    ~PredicatesMonitor() override;

    const QHash<QString, Solid::Predicate> &predicates();

private:
    explicit PredicatesMonitor(QObject *parent = nullptr);

    void updatePredicates(const QString &path);

Q_SIGNALS:
    void predicatesChanged(const QHash<QString, Solid::Predicate> &predicates);

private Q_SLOTS:
    void onPredicatesChanged(const QString &path);

private:
    KDirWatch *m_dirWatch;
    QHash<QString, Solid::Predicate> m_predicates;
};