Baloo

monitorcommand.h
1 /*
2  This file is part of the KDE Baloo Project
3  SPDX-FileCopyrightText: 2015 Pinak Ahuja <[email protected]>
4  SPDX-FileCopyrightText: 2015 Vishesh Handa <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8 
9 #ifndef MONITOR_H
10 #define MONITOR_H
11 
12 #include "command.h"
13 #include "fileindexerinterface.h"
14 #include "schedulerinterface.h"
15 #include <QObject>
16 #include <QTextStream>
17 #include <KLocalizedString>
18 
19 namespace Baloo {
20 
21 class MonitorCommand : public QObject, public Command
22 {
23  Q_OBJECT
24 public:
25  explicit MonitorCommand(QObject* parent = nullptr);
26 
27  QString command() override {
28  return QStringLiteral("monitor");
29  }
30 
31  QString description() override {
32  return i18n("CLI interface for monitoring Baloo");
33  }
34 
35  int exec(const QCommandLineParser& parser) override;
36 
37 private Q_SLOTS:
38  void startedIndexingFile(const QString& filePath);
39  void finishedIndexingFile(const QString& filePath);
40  void stateChanged(int state);
41  void balooIsAvailable();
42  void balooIsNotAvailable();
43 
44 private:
45  QTextStream m_out;
46  QTextStream m_err;
47  org::kde::baloo::fileindexer* m_indexerDBusInterface;
48  org::kde::baloo::scheduler* m_schedulerDBusInterface;
49  QString m_currentFile;
50  QDBusServiceWatcher* m_dbusServiceWatcher;
51 };
52 }
53 #endif // MONITOR_H
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QString i18n(const char *text, const TYPE &arg...)
Implements storage for docIds without any associated data Instantiated for:
Definition: coding.cpp:11
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Dec 11 2023 03:53:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.