Baloo

pendingfile.h
1 /*
2  This file is part of the KDE Baloo Project
3  SPDX-FileCopyrightText: 2014 Vishesh Handa <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7 
8 #ifndef BALOO_PENDINGFILE_H
9 #define BALOO_PENDINGFILE_H
10 
11 #include <QString>
12 #include <QObject>
13 
14 namespace Baloo {
15 
16 /**
17  * Represents a file which needs to be indexed.
18  */
20 {
21 public:
22  explicit PendingFile(const QString& path);
23 
24  QString path() const;
25 
26  void setAttributeChanged() { m_attributesChanged = true; }
27  void setClosedOnWrite() { m_closedOnWrite = true; }
28  void setModified() { m_modified = true; }
29  void setCreated() { m_created = true; }
30  void setDeleted() { m_deleted = true; }
31 
32  bool isNewFile() const;
33  bool shouldIndexContents() const;
34  bool shouldIndexXAttrOnly() const;
35  bool shouldRemoveIndex() const;
36 
37  bool operator == (const PendingFile& rhs) const {
38  return m_path == rhs.m_path;
39  }
40 
41  /**
42  * Takes a PendingFile \p file and merges its flags into
43  * the current PendingFile
44  */
45  void merge(const PendingFile& file);
46 
47 private:
48  QString m_path;
49 
50  bool m_created : 1;
51  bool m_closedOnWrite : 1;
52  bool m_attributesChanged : 1;
53  bool m_deleted : 1;
54  bool m_modified : 1;
55 
56  void printFlags() const;
57 };
58 
59 }
60 
61 Q_DECLARE_TYPEINFO(Baloo::PendingFile, Q_MOVABLE_TYPE);
62 
63 #endif // BALOO_PENDINGFILE_H
Represents a file which needs to be indexed.
Definition: pendingfile.h:19
Implements storage for docIds without any associated data Instantiated for:
Definition: coding.cpp:11
void merge(const PendingFile &file)
Takes a PendingFile file and merges its flags into the current PendingFile.
Definition: pendingfile.cpp:54
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.