]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileMonitor.h
amend 6144bbfb
[lyx.git] / src / support / FileMonitor.h
index ba84bb549e26d4918040f4df67e37699333f5c9c..d0d3741d4a7262a025f29dab1217ad847f1550c1 100644 (file)
 #ifndef FILEMONITOR_H
 #define FILEMONITOR_H
 
-#include <boost/utility.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
 
 namespace lyx {
 namespace support {
 
-class FileMonitor : boost::noncopyable {
+class FileName;
+
+class FileMonitor
+{
 public:
        /** Once monitoring begins, the file will be monitored every
         *  interval ms.
+        *
+        * FIXME: rewrite and simplify using an encapsulation of QFileSystemWatcher.
         */
-       FileMonitor(std::string const & file_with_path, int interval);
+       FileMonitor(FileName const & file_with_path, int interval);
 
-       /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
+       /// Destructor
        ~FileMonitor();
 
        ///
-       void reset(std::string const & file_with_path) const;
+       void reset(FileName const & file_with_path) const;
 
        ///
-       std::string const & filename() const;
+       FileName const & filename() const;
 
        /// Begin monitoring the file
        void start() const;
@@ -52,17 +55,20 @@ public:
        unsigned long checksum() const;
 
        /// Connect and you'll be informed when the file has changed.
-       typedef boost::signal<void()> FileChangedSig;
+       typedef boost::signals2::signal<void()> FileChangedSig;
        typedef FileChangedSig::slot_type slot_type;
        ///
-       boost::signals::connection connect(slot_type const &) const;
+       boost::signals2::connection connect(slot_type const &) const;
 
 private:
+       /// noncopyable
+       FileMonitor(FileMonitor const &);
+       void operator=(FileMonitor const &);
+
        /// Use the Pimpl idiom to hide the internals.
        class Impl;
-
        /// The pointer never changes although *pimpl_'s contents may.
-       boost::scoped_ptr<Impl> const pimpl_;
+       Impl * const pimpl_;
 };
 
 } // namespace support