• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Nepomuk-Core

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk-core
  • services
  • fileindexer
basicindexingqueue.h
Go to the documentation of this file.
1 /*
2  <one line to give the library's name and an idea of what it does.>
3  Copyright (C) 2012 Vishesh Handa <me@vhanda.in>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 
21 #ifndef BASICINDEXINGQUEUE_H
22 #define BASICINDEXINGQUEUE_H
23 
24 #include "indexingqueue.h"
25 #include <KJob>
26 #include <QtCore/QStack>
27 
28 namespace Nepomuk2 {
29 
30  enum UpdateDirFlag {
34  NoUpdateFlags = 0x0,
35 
39  UpdateRecursive = 0x1,
40 
45  AutoUpdateFolder = 0x2,
46 
51  ForceUpdate = 0x4
52  };
53  Q_DECLARE_FLAGS( UpdateDirFlags, UpdateDirFlag )
54 
55 
60  class BasicIndexingQueue: public IndexingQueue
61  {
62  Q_OBJECT
63  public:
64  explicit BasicIndexingQueue(QObject* parent = 0);
65 
66  QUrl currentUrl() const;
67  UpdateDirFlags currentFlags() const;
68 
69  virtual bool isEmpty();
70 
71  signals:
72  void beginIndexingFile(const QUrl& url);
73  void endIndexingFile(const QUrl& url);
74 
75  public slots:
76  void enqueue(const QString& path);
77  void enqueue(const QString& path, UpdateDirFlags flags);
78 
79  void clear();
80  void clear( const QString& path );
81 
82  protected:
83  virtual void processNextIteration();
84 
85  private slots:
86  void slotClearIndexedDataFinished(KJob* job);
87  void slotIndexingFinished(KJob* job);
88 
89  private:
94  void index(const QString& path);
95 
96  bool shouldIndex(const QString& path, const QString& mimetype);
97  bool shouldIndexContents(const QString& dir);
98 
107  bool process(const QString& path, Nepomuk2::UpdateDirFlags flags);
108 
109  QStack< QPair<QString, UpdateDirFlags> > m_paths;
110 
111  QUrl m_currentUrl;
112  QString m_currentMimeType;
113  UpdateDirFlags m_currentFlags;
114  };
115 
116 }
117 
118 Q_DECLARE_OPERATORS_FOR_FLAGS(Nepomuk2::UpdateDirFlags)
119 
120 #endif // BASICINDEXINGQUEUE_H
Nepomuk2::ForceUpdate
The files in the folder should be updated regardless of their state.
Definition: basicindexingqueue.h:51
QObject
Nepomuk2::NoUpdateFlags
No flags, only used to make code more readable.
Definition: basicindexingqueue.h:34
Nepomuk2::BasicIndexingQueue
This class represents a simple queue that iterates over the file system tree and indexes each file wh...
Definition: basicindexingqueue.h:60
indexingqueue.h
Nepomuk2::UpdateRecursive
The folder should be updated recursive.
Definition: basicindexingqueue.h:39
Nepomuk2::IndexingQueue
An abstract class representing the queue.
Definition: indexingqueue.h:36
Nepomuk2::UpdateDirFlag
UpdateDirFlag
Definition: basicindexingqueue.h:30
Nepomuk2::AutoUpdateFolder
The folder has been scheduled to update by the update system, not by a call to updateDir.
Definition: basicindexingqueue.h:45
KJob
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal