• 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.cpp
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  Copyright (c) 2012-2013 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 Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "nepomukfilewatch.h"
21 #include "metadatamover.h"
22 #include "fileindexerinterface.h"
23 #include "filewatchadaptor.h"
24 #include "fileexcludefilters.h"
25 #include "removabledeviceindexnotification.h"
26 #include "removablemediacache.h"
27 #include "fileindexerconfig.h"
28 #include "activefilequeue.h"
29 #include "removablemediadatamigrator.h"
30 
31 #ifdef BUILD_KINOTIFY
32 #include "kinotify.h"
33 #endif
34 
35 #include <QtCore/QDir>
36 #include <QtCore/QThread>
37 #include <QtDBus/QDBusConnection>
38 
39 #include <KDebug>
40 #include <KUrl>
41 #include <KConfigGroup>
42 #include <KLocale>
43 
44 #include "resourcemanager.h"
45 #include "nie.h"
46 
47 #include <Soprano/Model>
48 #include <Soprano/QueryResultIterator>
49 #include <Soprano/Node>
50 
51 using namespace Nepomuk2::Vocabulary;
52 
53 
54 #ifdef BUILD_KINOTIFY
55 namespace {
60  class IgnoringKInotify : public KInotify
61  {
62  public:
63  IgnoringKInotify( RegExpCache* rec, QObject* parent );
64  ~IgnoringKInotify();
65 
66  protected:
67  bool filterWatch( const QString & path, WatchEvents & modes, WatchFlags & flags );
68 
69  private:
70  RegExpCache* m_pathExcludeRegExpCache;
71  };
72 
73  IgnoringKInotify::IgnoringKInotify( RegExpCache* rec, QObject* parent )
74  : KInotify( parent ),
75  m_pathExcludeRegExpCache( rec )
76  {
77  }
78 
79  IgnoringKInotify::~IgnoringKInotify()
80  {
81  }
82 
83  bool IgnoringKInotify::filterWatch( const QString & path, WatchEvents & modes, WatchFlags & flags )
84  {
85  Q_UNUSED( flags );
86 
87  QStringList cpts = path.split('/', QString::SkipEmptyParts);
88  if( cpts.isEmpty() )
89  return false;
90 
91  // We only check the final componenet instead of all the components cause the
92  // earlier ones would have already been tested by this function
93  QString file = cpts.last();
94 
95  bool shouldFileNameBeIndexed = Nepomuk2::FileIndexerConfig::self()->shouldFileBeIndexed( file );
96  if( !shouldFileNameBeIndexed ) {
97  // If the path should not be indexed then we do not want to watch it
98  // This is an optimization
99  return false;
100  }
101 
102  bool shouldFolderBeIndexed = Nepomuk2::FileIndexerConfig::self()->folderInFolderList( path );
103 
104  // Only watch the index folders for file change.
105  // We still need to monitor everything for file creation because directories count as
106  // files, and we want to recieve signals for a new directory, so that we can watch it.
107  if( shouldFolderBeIndexed && shouldFileNameBeIndexed ) {
108  modes |= KInotify::EventCloseWrite;
109  }
110  else {
111  modes &= (~KInotify::EventCloseWrite);
112  }
113  return true;
114  }
115 }
116 #endif // BUILD_KINOTIFY
117 
118 
119 Nepomuk2::FileWatch::FileWatch()
120  : Service2()
121 #ifdef BUILD_KINOTIFY
122  , m_dirWatch( 0 )
123 #endif
124  , m_isIdle(true)
125 {
126  // Create the configuration instance singleton (for thread-safety)
127  // ==============================================================
128  (void)new FileIndexerConfig(this);
129  resetStatusMessage();
130 
131  // the list of default exclude filters we use here differs from those
132  // that can be configured for the file indexer service
133  // the default list should only contain files and folders that users are
134  // very unlikely to ever annotate but that change very often. This way
135  // we avoid a lot of work while hopefully not breaking the workflow of
136  // too many users.
137  m_pathExcludeRegExpCache = new RegExpCache();
138  m_pathExcludeRegExpCache->rebuildCacheFromFilterList( defaultExcludeFilterList() );
139 
140  // start the mover thread
141  m_metadataMoverThread = new QThread(this);
142  m_metadataMoverThread->start();
143  m_metadataMover = new MetadataMover( ResourceManager::instance()->mainModel() );
144  connect( m_metadataMover, SIGNAL(movedWithoutData(QString)),
145  this, SLOT(slotMovedWithoutData(QString)),
146  Qt::QueuedConnection );
147  connect( m_metadataMover, SIGNAL(statusMessage(QString)),
148  this, SLOT(updateStatusMessage(QString)),
149  Qt::QueuedConnection );
150  connect( m_metadataMover, SIGNAL(metadataUpdateStopped()),
151  this, SLOT(resetStatusMessage()),
152  Qt::QueuedConnection );
153  m_metadataMover->moveToThread(m_metadataMoverThread);
154 
155  m_fileModificationQueue = new ActiveFileQueue(this);
156  connect(m_fileModificationQueue, SIGNAL(urlTimeout(QString)),
157  this, SLOT(slotActiveFileQueueTimeout(QString)));
158 
159 #ifdef BUILD_KINOTIFY
160  // monitor the file system for changes (restricted by the inotify limit)
161  m_dirWatch = new IgnoringKInotify( m_pathExcludeRegExpCache, this );
162 
163  connect( m_dirWatch, SIGNAL( moved( QString, QString ) ),
164  this, SLOT( slotFileMoved( QString, QString ) ) );
165  connect( m_dirWatch, SIGNAL( deleted( QString, bool ) ),
166  this, SLOT( slotFileDeleted( QString, bool ) ) );
167  connect( m_dirWatch, SIGNAL( created( QString, bool ) ),
168  this, SLOT( slotFileCreated( QString, bool ) ) );
169  connect( m_dirWatch, SIGNAL( closedWrite( QString ) ),
170  this, SLOT( slotFileClosedAfterWrite( QString ) ) );
171  connect( m_dirWatch, SIGNAL( watchUserLimitReached( QString ) ),
172  this, SLOT( slotInotifyWatchUserLimitReached( QString ) ) );
173 
174  // recursively watch the whole home dir
175 
176  // FIXME: we cannot simply watch the folders that contain annotated files since moving
177  // one of these files out of the watched "area" would mean we "lose" it, i.e. we have no
178  // information about where it is moved.
179  // On the other hand only using the homedir means a lot of restrictions.
180  // One dummy solution would be a hybrid: watch the whole home dir plus all folders that
181  // contain annotated files outside of the home dir and hope for the best
182 
183  const QString home = QDir::homePath();
184  watchFolder( home );
185 
186  //Watch all indexed folders unless they are subdirectories of home, which is already watched
187  QStringList folders = FileIndexerConfig::self()->includeFolders();
188  foreach( const QString & folder, folders ) {
189  if( !folder.startsWith( home ) ) {
190  watchFolder( folder );
191  }
192  }
193 #else
194  connectToKDirNotify();
195 #endif
196 
197  // we automatically watch newly mounted media - it is very unlikely that anything non-interesting is mounted
198  m_removableMediaCache = new RemovableMediaCache(this);
199  connect(m_removableMediaCache, SIGNAL(deviceMounted(const Nepomuk2::RemovableMediaCache::Entry*)),
200  this, SLOT(slotDeviceMounted(const Nepomuk2::RemovableMediaCache::Entry*)));
201  connect(m_removableMediaCache, SIGNAL(deviceTeardownRequested(const Nepomuk2::RemovableMediaCache::Entry*)),
202  this, SLOT(slotDeviceTeardownRequested(const Nepomuk2::RemovableMediaCache::Entry*)));
203  addWatchesForMountedRemovableMedia();
204 
205  connect( FileIndexerConfig::self(), SIGNAL( configChanged() ),
206  this, SLOT( updateIndexedFoldersWatches() ) );
207 }
208 
209 
210 Nepomuk2::FileWatch::~FileWatch()
211 {
212  kDebug();
213  m_metadataMoverThread->quit();
214  m_metadataMoverThread->wait();
215  delete m_metadataMover;
216 }
217 
218 
219 // FIXME: listen to Create for folders!
220 void Nepomuk2::FileWatch::watchFolder( const QString& path )
221 {
222  kDebug() << path;
223 #ifdef BUILD_KINOTIFY
224  if ( m_dirWatch && !m_dirWatch->watchingPath( path ) )
225  m_dirWatch->addWatch( path,
226  KInotify::WatchEvents( KInotify::EventMove|KInotify::EventDelete|KInotify::EventDeleteSelf|KInotify::EventCloseWrite|KInotify::EventCreate ),
227  KInotify::WatchFlags() );
228 #endif
229 }
230 
231 bool Nepomuk2::FileWatch::isUpdatingMetaData() const
232 {
233  return !m_isIdle;
234 }
235 
236 QString Nepomuk2::FileWatch::statusMessage() const
237 {
238  return m_statusMessage;
239 }
240 
241 void Nepomuk2::FileWatch::slotFileMoved( const QString& urlFrom, const QString& urlTo )
242 {
243  if( !ignorePath( urlFrom ) || !ignorePath( urlTo ) ) {
244  const KUrl from( urlFrom );
245  const KUrl to( urlTo );
246  m_metadataMover->moveFileMetadata( from, to );
247  }
248 }
249 
250 
251 void Nepomuk2::FileWatch::slotFilesDeleted( const QStringList& paths )
252 {
253  KUrl::List urls;
254  foreach( const QString& path, paths ) {
255  if( !ignorePath( path ) ) {
256  urls << KUrl(path);
257  }
258  }
259 
260  if( !urls.isEmpty() ) {
261  m_metadataMover->removeFileMetadata( urls );
262  }
263 }
264 
265 
266 void Nepomuk2::FileWatch::slotFileDeleted( const QString& urlString, bool isDir )
267 {
268  // Directories must always end with a trailing slash '/'
269  QString url = urlString;
270  if( isDir && url[ url.length() - 1 ] != '/') {
271  url.append('/');
272  }
273  slotFilesDeleted( QStringList( url ) );
274 }
275 
276 
277 void Nepomuk2::FileWatch::slotFileCreated( const QString& path, bool isDir )
278 {
279  // we only need the file creation event for folders
280  // file creation is always followed by a CloseAfterWrite event
281  if(isDir) {
282  updateFileViaFileIndexer(path);
283  }
284 }
285 
286 void Nepomuk2::FileWatch::slotFileClosedAfterWrite( const QString& path )
287 {
288  QDateTime current = QDateTime::currentDateTime();
289  QDateTime fileModification = QFileInfo(path).lastModified();
290  QDateTime dirModification = QFileInfo(QFileInfo(path).absoluteDir().absolutePath()).lastModified();
291 
292  // If we have recieved a FileClosedAfterWrite event, then the file must have been
293  // closed within the last minute.
294  // This is being done cause many applications open the file under write mode, do not
295  // make any modifications and then close the file. This results in us getting
296  // the FileClosedAfterWrite event
297  if( fileModification.secsTo(current) <= 1000 * 60 ||
298  dirModification.secsTo(current) <= 1000 * 60) {
299  m_fileModificationQueue->enqueueUrl( path );
300  }
301 }
302 
303 void Nepomuk2::FileWatch::slotMovedWithoutData( const QString& path )
304 {
305  updateFileViaFileIndexer( path );
306 }
307 
308 
309 // static
310 void Nepomuk2::FileWatch::updateFileViaFileIndexer(const QString &path)
311 {
312  if( FileIndexerConfig::self()->shouldBeIndexed(path) ) {
313  org::kde::nepomuk::FileIndexer fileIndexer( "org.kde.nepomuk.services.nepomukfileindexer", "/nepomukfileindexer", QDBusConnection::sessionBus() );
314  if ( fileIndexer.isValid() ) {
315  fileIndexer.indexFile( path );
316  }
317  }
318 }
319 
320 
321 // static
322 void Nepomuk2::FileWatch::updateFolderViaFileIndexer( const QString& path )
323 {
324  if( FileIndexerConfig::self()->shouldBeIndexed(path) ) {
325  //
326  // Tell the file indexer service (if running) to update the newly created
327  // folder or the folder containing the newly created file
328  //
329  org::kde::nepomuk::FileIndexer fileIndexer( "org.kde.nepomuk.services.nepomukfileindexer", "/nepomukfileindexer", QDBusConnection::sessionBus() );
330  if ( fileIndexer.isValid() ) {
331  fileIndexer.updateFolder( path, false /* non-recursive */, false /* no forced update */ );
332  }
333  }
334 }
335 
336 
337 void Nepomuk2::FileWatch::connectToKDirNotify()
338 {
339  // monitor KIO for changes
340  QDBusConnection::sessionBus().connect( QString(), QString(), "org.kde.KDirNotify", "FileMoved",
341  this, SIGNAL( slotFileMoved( const QString&, const QString& ) ) );
342  QDBusConnection::sessionBus().connect( QString(), QString(), "org.kde.KDirNotify", "FilesRemoved",
343  this, SIGNAL( slotFilesDeleted( const QStringList& ) ) );
344 }
345 
346 
347 #ifdef BUILD_KINOTIFY
348 
349 #include <syslog.h>
350 #include <kauth.h>
351 
352 //Try to raise the inotify watch limit by executing
353 //a helper which modifies /proc/sys/fs/inotify/max_user_watches
354 bool raiseWatchLimit() {
355  KAuth::Action limitAction("org.kde.nepomuk.filewatch.raiselimit");
356  limitAction.setHelperID("org.kde.nepomuk.filewatch");
357 
358  KAuth::ActionReply reply = limitAction.execute();
359  if (reply.failed()) {
360  return false;
361  }
362  return true;
363 }
364 
365 //This slot is connected to a signal emitted in KInotify when
366 //inotify_add_watch fails with ENOSPC.
367 void Nepomuk2::FileWatch::slotInotifyWatchUserLimitReached( const QString& path )
368 {
369  if ( raiseWatchLimit() ) {
370  kDebug() << "Successfully raised watch limit, re-adding " << path;
371  if( m_dirWatch )
372  m_dirWatch->resetUserLimit();
373  watchFolder( path );
374  }
375  else {
376  //If we got here, we hit the limit and couldn't authenticate to raise it,
377  // so put something in the syslog so someone notices.
378  syslog(LOG_USER | LOG_WARNING, "KDE Nepomuk Filewatch service reached the folder watch limit. File changes may be ignored.");
379  // we do it the brutal way for now hoping with new kernels and defaults this will never happen
380  // Delete the KInotify and switch to KDirNotify dbus signals
381  if( m_dirWatch ) {
382  m_dirWatch->deleteLater();
383  m_dirWatch = 0;
384  }
385  connectToKDirNotify();
386  }
387 }
388 #endif
389 
390 
391 bool Nepomuk2::FileWatch::ignorePath( const QString& path )
392 {
393  // when using KInotify there is no need to check the folder since
394  // we only watch interesting folders to begin with.
395  return m_pathExcludeRegExpCache->filenameMatch( path );
396 }
397 
398 
399 void Nepomuk2::FileWatch::updateIndexedFoldersWatches()
400 {
401 #ifdef BUILD_KINOTIFY
402  if( m_dirWatch ) {
403  QStringList folders = FileIndexerConfig::self()->includeFolders();
404  foreach( const QString & folder, folders ) {
405  m_dirWatch->removeWatch( folder );
406  watchFolder( folder );
407  }
408  }
409 #endif
410 }
411 
412 
413 void Nepomuk2::FileWatch::addWatchesForMountedRemovableMedia()
414 {
415  Q_FOREACH(const RemovableMediaCache::Entry* entry, m_removableMediaCache->allMedia()) {
416  if(entry->isMounted())
417  slotDeviceMounted(entry);
418  }
419 }
420 
421 void Nepomuk2::FileWatch::slotDeviceMounted(const Nepomuk2::RemovableMediaCache::Entry* entry)
422 {
423  //
424  // tell the file indexer to update the newly mounted device
425  //
426  KConfig fileIndexerConfig( "nepomukstrigirc" );
427  const QByteArray devGroupName( "Device-" + entry->url().toUtf8() );
428  int index = 0;
429  // Old-format -> port to new format
430  if(fileIndexerConfig.group("Devices").hasKey(entry->url())) {
431  KConfigGroup devicesGroup = fileIndexerConfig.group( "Devices" );
432  index = devicesGroup.readEntry(entry->url(), false) ? 1 : -1;
433  devicesGroup.deleteEntry( entry->url() );
434 
435  KConfigGroup devGroup = fileIndexerConfig.group( devGroupName );
436  devGroup.writeEntry( "mount path", entry->mountPath() );
437  if( index == 1 )
438  devGroup.writeEntry( "folders", QStringList() << QLatin1String("/") );
439  else if( index == -1 )
440  devGroup.writeEntry( "exclude folders", QStringList() << QLatin1String("/") );
441 
442  fileIndexerConfig.sync();
443 
444  // Migrate the existing filex data
445  RemovableMediaDataMigrator* migrator = new RemovableMediaDataMigrator( entry );
446  QThreadPool::globalInstance()->start( migrator );
447  }
448 
449  // Already exists
450  else if( fileIndexerConfig.hasGroup( devGroupName ) ) {
451  // Inform the indexer to start the indexing process
452 
453  org::kde::nepomuk::FileIndexer fileIndexer( "org.kde.nepomuk.services.nepomukfileindexer", "/nepomukfileindexer", QDBusConnection::sessionBus() );
454  if ( fileIndexer.isValid() ) {
455  KConfigGroup group = fileIndexerConfig.group( devGroupName );
456  const QString mountPath = group.readEntry( "mount path", QString() );
457  if( !mountPath.isEmpty() ) {
458  const QStringList folders = group.readPathEntry("folders", QStringList());
459  foreach( const QString& folder, folders ) {
460  QString path = mountPath + folder;
461  fileIndexer.indexFolder( path, true, false );
462  }
463  }
464  }
465 
466  index = 1;
467  }
468 
469  const bool indexNewlyMounted = fileIndexerConfig.group( "RemovableMedia" ).readEntry( "index newly mounted", false );
470  const bool askIndividually = fileIndexerConfig.group( "RemovableMedia" ).readEntry( "ask user", false );
471 
472  if( index == 0 && indexNewlyMounted && !askIndividually ) {
473  KConfigGroup deviceGroup = fileIndexerConfig.group( "Device-" + entry->url() );
474  deviceGroup.writeEntry( "folders", QStringList() << entry->mountPath() );
475 
476  index = 1;
477  }
478 
479  // ask the user if we should index
480  else if( index == 0 && indexNewlyMounted && askIndividually ) {
481  kDebug() << "Device unknown. Asking user for action.";
482  (new RemovableDeviceIndexNotification(entry, this))->sendEvent();
483  }
484 
485  //
486  // Install the watches
487  //
488  KConfig config("nepomukstrigirc");
489  KConfigGroup cfg = config.group( "RemovableMedia" );
490 
491  if( cfg.readEntry<bool>( "add watches", true ) ) {
492  QString path = entry->mountPath();
493  // If the device is not a storage device, mountPath returns QString().
494  // In this case do not try to install watches.
495  if( path.isEmpty() )
496  return;
497  if( entry->device().isDeviceInterface( Solid::DeviceInterface::NetworkShare ) ) {
498  if( cfg.readEntry<bool>( "add watches network share", false ) ) {
499  kDebug() << "Installing watch for network share at mount point" << path;
500  watchFolder(path);
501  }
502  }
503  else {
504  kDebug() << "Installing watch for removable storage at mount point" << path;
505  // vHanda: Perhaps this should only be done if we have some metadata on the removable media
506  // and if we do not then we add the watches when we get some metadata?
507  watchFolder(path);
508  }
509  }
510 }
511 
512 void Nepomuk2::FileWatch::slotDeviceTeardownRequested(const Nepomuk2::RemovableMediaCache::Entry* entry )
513 {
514 #ifdef BUILD_KINOTIFY
515  if( m_dirWatch ) {
516  kDebug() << entry->mountPath();
517  m_dirWatch->removeWatch( entry->mountPath() );
518  }
519 #endif
520 }
521 
522 
523 void Nepomuk2::FileWatch::slotActiveFileQueueTimeout(const QString& url)
524 {
525  kDebug() << url;
526  updateFileViaFileIndexer(url);
527 }
528 
529 void Nepomuk2::FileWatch::updateStatusMessage(const QString &newStatus)
530 {
531  m_statusMessage = newStatus;
532 
533  if( m_isIdle ) {
534  emit metadataUpdateStarted();
535  m_isIdle = false;
536  }
537 
538  emit status(1, m_statusMessage);
539 }
540 
541 void Nepomuk2::FileWatch::resetStatusMessage()
542 {
543  m_isIdle = true;
544 
545  m_statusMessage = i18n( "The File Watcher is idle." );
546 
547  emit metadataUpdateStopped();
548  emit status( 0, m_statusMessage );
549 }
550 
551 int main( int argc, char **argv ) {
552  KAboutData aboutData( "nepomukfilewatch",
553  "nepomukfilewatch",
554  ki18n("Nepomuk File Watch"),
555  NEPOMUK_VERSION_STRING,
556  ki18n("Nepomuk File Watch"),
557  KAboutData::License_GPL,
558  ki18n("(c) 2008-2013, Sebastian Trüg"),
559  KLocalizedString(),
560  "http://nepomuk.kde.org" );
561  aboutData.addAuthor(ki18n("Sebastian Trüg"),ki18n("Developer"), "trueg@kde.org");
562  aboutData.addAuthor(ki18n("Vishesh Handa"),ki18n("Maintainer"), "me@vhanda.in");
563 
564  Nepomuk2::Service2::initUI<Nepomuk2::FileWatch>( argc, argv, aboutData );
565 }
566 
567 #include "nepomukfilewatch.moc"
fileindexerconfig.h
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
removablemediadatamigrator.h
KInotify
A simple wrapper around inotify which only allows to add folders recursively.
Definition: kinotify.h:33
Nepomuk2::FileWatch::~FileWatch
~FileWatch()
Definition: nepomukfilewatch.cpp:210
metadatamover.h
RegExpCache::rebuildCacheFromFilterList
void rebuildCacheFromFilterList(const QStringList &filters)
Definition: regexpcache.cpp:60
Nepomuk2::RemovableMediaCache::Entry::mountPath
QString mountPath() const
Definition: removablemediacache.cpp:322
main
int main(int argc, char **argv)
Definition: nepomukfilewatch.cpp:551
activefilequeue.h
KInotify::EventDelete
File/directory created in watched directory (compare inotify's IN_CREATE)
Definition: kinotify.h:53
ActiveFileQueue
The active file queue maintains a queue of file paths with a timestamp.
Definition: activefilequeue.h:46
Nepomuk2::FileIndexerConfig::includeFolders
QStringList includeFolders() const
The folders to search for files to analyze.
Definition: fileindexerconfig.cpp:94
Nepomuk2::FileIndexerConfig
Active config class which emits signals if the config was changed, for example if the KCM saved the c...
Definition: fileindexerconfig.h:38
QObject
KInotify::EventCreate
Definition: kinotify.h:52
Nepomuk2::RemovableMediaCache
The removable media cache provides access to all removable media that are supported by Nepomuk...
Definition: removablemediacache.h:45
Nepomuk2::RemovableMediaCache::Entry::device
Solid::Device device() const
Definition: removablemediacache.h:66
removablemediacache.h
KInotify::EventDeleteSelf
Watched file/directory was itself deleted (compare inotify's IN_DELETE_SELF)
Definition: kinotify.h:54
Nepomuk2::FileIndexerConfig::folderInFolderList
bool folderInFolderList(const QString &path)
Returns true if the folder is in the list indexed directories and not in the list of exclude director...
Definition: fileindexerconfig.cpp:226
Nepomuk2::Service2
New Base class for all Nepomuk services.
Definition: service2.h:88
Nepomuk2::FileIndexerConfig::shouldFileBeIndexed
bool shouldFileBeIndexed(const QString &fileName) const
Check fileName for all exclude filters.
Definition: fileindexerconfig.cpp:212
Nepomuk2::FileWatch::metadataUpdateStopped
Q_SCRIPTABLE void metadataUpdateStopped()
Emitted when the watcher stops to do something.
Nepomuk2::RemovableMediaCache::Entry
Definition: removablemediacache.h:53
fileexcludefilters.h
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
Nepomuk2::defaultExcludeFilterList
NEPOMUKCOMMON_EXPORT QStringList defaultExcludeFilterList()
Definition: fileexcludefilters.cpp:103
KInotify::EventCloseWrite
File opened for writing was closed (compare inotify's IN_CLOSE_WRITE)
Definition: kinotify.h:50
RegExpCache
Definition: regexpcache.h:30
Nepomuk2::ResourceManager::instance
static ResourceManager * instance()
Definition: resourcemanager.cpp:270
KInotify::EventMove
Definition: kinotify.h:63
resourcemanager.h
removabledeviceindexnotification.h
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
RemovableDeviceIndexNotification
Definition: removabledeviceindexnotification.h:31
Nepomuk2::FileWatch::statusMessage
Q_SCRIPTABLE QString statusMessage() const
Returns a translated status message that indicates what is happening.
Definition: nepomukfilewatch.cpp:236
Nepomuk2::RemovableMediaCache::Entry::url
QString url() const
Definition: removablemediacache.h:67
nepomukfilewatch.h
Nepomuk2::FileIndexerConfig::self
static FileIndexerConfig * self()
Get the first created instance of FileIndexerConfig.
Definition: fileindexerconfig.cpp:82
Nepomuk2::FileWatch::FileWatch
FileWatch()
Definition: nepomukfilewatch.cpp:119
kinotify.h
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