2012-12-05 21:30:40 +04:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Markus Goetz <markus@woboq.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2016-10-25 12:00:07 +03:00
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2012-12-05 21:30:40 +04:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MIRALL_FOLDERWATCHER_MAC_H
|
|
|
|
#define MIRALL_FOLDERWATCHER_MAC_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
#include <CoreServices/CoreServices.h>
|
|
|
|
|
|
|
|
|
2014-11-10 00:34:07 +03:00
|
|
|
namespace OCC {
|
2012-12-05 21:30:40 +04:00
|
|
|
|
2015-06-29 19:56:09 +03:00
|
|
|
/**
|
|
|
|
* @brief Mac OS X API implementation of FolderWatcher
|
|
|
|
* @ingroup gui
|
2015-06-26 18:07:47 +03:00
|
|
|
*/
|
2012-12-05 21:30:40 +04:00
|
|
|
class FolderWatcherPrivate
|
|
|
|
{
|
|
|
|
public:
|
2014-01-13 19:00:41 +04:00
|
|
|
FolderWatcherPrivate(FolderWatcher *p, const QString &path);
|
2012-12-05 21:30:40 +04:00
|
|
|
~FolderWatcherPrivate();
|
|
|
|
|
|
|
|
void startWatching();
|
2020-09-16 20:50:16 +03:00
|
|
|
QStringList addCoalescedPaths(const QStringList &) const;
|
2014-02-18 03:36:41 +04:00
|
|
|
void doNotifyParent(const QStringList &);
|
2012-12-05 21:30:40 +04:00
|
|
|
|
2019-07-11 14:31:54 +03:00
|
|
|
/// On OSX the watcher is ready when the ctor finished.
|
|
|
|
bool _ready = true;
|
|
|
|
|
2012-12-05 21:30:40 +04:00
|
|
|
private:
|
2014-01-13 19:00:41 +04:00
|
|
|
FolderWatcher *_parent;
|
2012-12-05 21:30:40 +04:00
|
|
|
|
2014-01-13 19:00:41 +04:00
|
|
|
QString _folder;
|
2012-12-05 21:30:40 +04:00
|
|
|
|
2014-02-19 03:46:48 +04:00
|
|
|
FSEventStreamRef _stream;
|
2012-12-05 21:30:40 +04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|