+/// When a more active monitoring style is needed.
+/// For instance because QFileSystemWatcher does not work for remote file
+/// systems.
+class ActiveFileMonitor : public FileMonitor
+{
+ Q_OBJECT
+public:
+ ActiveFileMonitor(std::shared_ptr<FileMonitorGuard> monitor,
+ FileName const & filename, int interval);
+ /// call checkModified asynchronously
+ void checkModifiedAsync();
+
+public Q_SLOTS:
+ /// Check explicitly for a modification, but not more than once every
+ /// interval ms.
+ void checkModified();
+
+private Q_SLOTS:
+ void setCooldown() { cooldown_ = true; }
+ void clearCooldown() { cooldown_ = false; }
+
+private:
+ FileName const filename_;
+ ///
+ int const interval_;
+ ///
+ time_t timestamp_;
+ ///
+ unsigned long checksum_;
+ ///
+ bool cooldown_;
+};
+