• 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
  • filewatch
nepomukfilewatch.h
Go to the documentation of this file.
1 /* This file is part of the KDE Project
2  Copyright (c) 2007-2011 Sebastian Trueg <trueg@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef _NEPOMUK_FILE_WATCH_H_
20 #define _NEPOMUK_FILE_WATCH_H_
21 
22 #include "service2.h"
23 
24 #include <QtCore/QUrl>
25 #include <QtCore/QVariant>
26 #include <QtCore/QSet>
27 
28 #include "removablemediacache.h"
29 
30 class KInotify;
31 class KUrl;
32 class RegExpCache;
33 class ActiveFileQueue;
34 class QThread;
35 
36 namespace Nepomuk2 {
37 
38  class MetadataMover;
39 
40  class FileWatch : public Service2
41  {
42  Q_OBJECT
43  Q_CLASSINFO( "D-Bus Interface", "org.kde.nepomuk.FileWatch" )
44 
45  public:
46  FileWatch();
47  ~FileWatch();
48 
53  static void updateFileViaFileIndexer( const QString& path );
54 
59  static void updateFolderViaFileIndexer( const QString& path );
60 
61  Q_SIGNALS:
71  Q_SCRIPTABLE void status(int status, QString msg);
72 
76  Q_SCRIPTABLE void metadataUpdateStarted();
77 
81  Q_SCRIPTABLE void metadataUpdateStopped();
82 
83  public Q_SLOTS:
90  Q_SCRIPTABLE bool isUpdatingMetaData() const;
91 
97  Q_SCRIPTABLE QString statusMessage() const;
98 
99  private Q_SLOTS:
100  void slotFileMoved( const QString& from, const QString& to );
101  void slotFileDeleted( const QString& urlString, bool isDir );
102  void slotFilesDeleted( const QStringList& path );
103  void slotFileCreated( const QString& path, bool isDir );
104  void slotFileClosedAfterWrite( const QString& );
105  void slotMovedWithoutData( const QString& );
106  void connectToKDirNotify();
107 #ifdef BUILD_KINOTIFY
108  void slotInotifyWatchUserLimitReached( const QString& );
109 #endif
110 
115  void updateIndexedFoldersWatches();
116 
122  void slotDeviceMounted( const Nepomuk2::RemovableMediaCache::Entry* );
123 
128  void slotDeviceTeardownRequested( const Nepomuk2::RemovableMediaCache::Entry* );
129 
130  void slotActiveFileQueueTimeout(const QString& url);
131 
137  void updateStatusMessage(const QString &newStatus);
138 
144  void resetStatusMessage();
145 
146  private:
148  void watchFolder( const QString& path );
149 
153  void addWatchesForMountedRemovableMedia();
154 
160  bool ignorePath( const QString& path );
161 
162  QThread* m_metadataMoverThread;
163  MetadataMover* m_metadataMover;
164 
165 #ifdef BUILD_KINOTIFY
166  KInotify* m_dirWatch;
167 #endif
168 
169  RegExpCache* m_pathExcludeRegExpCache;
170  RemovableMediaCache* m_removableMediaCache;
171 
173  ActiveFileQueue* m_fileModificationQueue;
174 
175  bool m_isIdle;
179  QString m_statusMessage;
180  };
181 }
182 
183 #endif
Nepomuk2::FileWatch::isUpdatingMetaData
Q_SCRIPTABLE bool isUpdatingMetaData() const
Returns if the watcher is doing something.
Definition: nepomukfilewatch.cpp:231
Nepomuk2::MetadataMover
Definition: metadatamover.h:38
Nepomuk2::FileWatch::metadataUpdateStarted
Q_SCRIPTABLE void metadataUpdateStarted()
Emitted when the watcher starts to do something.
KInotify
A simple wrapper around inotify which only allows to add folders recursively.
Definition: kinotify.h:33
Nepomuk2::FileWatch
Definition: nepomukfilewatch.h:40
Nepomuk2::FileWatch::~FileWatch
~FileWatch()
Definition: nepomukfilewatch.cpp:210
Nepomuk2::FileWatch::status
Q_SCRIPTABLE void status(int status, QString msg)
Emitted each time the status/activity of the FileWatcher changes.
ActiveFileQueue
The active file queue maintains a queue of file paths with a timestamp.
Definition: activefilequeue.h:46
Nepomuk2::RemovableMediaCache
The removable media cache provides access to all removable media that are supported by Nepomuk...
Definition: removablemediacache.h:45
removablemediacache.h
Nepomuk2::Service2
New Base class for all Nepomuk services.
Definition: service2.h:88
service2.h
Nepomuk2::FileWatch::metadataUpdateStopped
Q_SCRIPTABLE void metadataUpdateStopped()
Emitted when the watcher stops to do something.
Nepomuk2::RemovableMediaCache::Entry
Definition: removablemediacache.h:53
Nepomuk2::FileWatch::updateFolderViaFileIndexer
static void updateFolderViaFileIndexer(const QString &path)
Tells the file indexer to update the folder at path or the folder containing path in case it is a fil...
Definition: nepomukfilewatch.cpp:322
RegExpCache
Definition: regexpcache.h:30
Nepomuk2::FileWatch::updateFileViaFileIndexer
static void updateFileViaFileIndexer(const QString &path)
Tells the file indexer to update the file (it can also be a folder but then updating will not be recu...
Definition: nepomukfilewatch.cpp:310
Nepomuk2::FileWatch::statusMessage
Q_SCRIPTABLE QString statusMessage() const
Returns a translated status message that indicates what is happening.
Definition: nepomukfilewatch.cpp:236
Nepomuk2::FileWatch::FileWatch
FileWatch()
Definition: nepomukfilewatch.cpp:119
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