]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileMonitor.C
* lyxfunctional.h: delete compare_memfun and helper classes
[lyx.git] / src / support / FileMonitor.C
index 6ab2a18e2aade01a930bff4b45971fa2b89d64f2..4a7fa07bf36dda81601d44b9216043f621b7a415 100644 (file)
@@ -5,7 +5,7 @@
  *
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 #include <boost/bind.hpp>
 #include <boost/signals/trackable.hpp>
 
+
+using std::string;
+
+
+namespace lyx {
+namespace support {
+
 struct FileMonitor::Impl : public boost::signals::trackable {
 
        ///
@@ -35,7 +42,7 @@ struct FileMonitor::Impl : public boost::signals::trackable {
        Timeout timer_;
 
        /// This signal is emitted if the file is modified (has a new checksum).
-       boost::signal0<void> fileChanged_;
+       FileMonitor::FileChangedSig fileChanged_;
 
        /** We use these to ascertain whether a file (once loaded successfully)
         *  has changed.
@@ -87,7 +94,7 @@ void FileMonitor::start() const
                return;
 
        pimpl_->timestamp_ = finfo.getModificationTime();
-       pimpl_->checksum_ = lyx::sum(pimpl_->filename_);
+       pimpl_->checksum_ = sum(pimpl_->filename_);
 
        if (pimpl_->timestamp_ && pimpl_->checksum_) {
                pimpl_->timer_.start();
@@ -117,7 +124,7 @@ unsigned long FileMonitor::checksum() const
        // If we aren't actively monitoring the file, then recompute the
        // checksum explicitly.
        if (!pimpl_->timer_.running() && !pimpl_->filename_.empty())
-               return lyx::sum(pimpl_->filename_);
+               return sum(pimpl_->filename_);
 
        return pimpl_->checksum_;
 }
@@ -160,7 +167,7 @@ void FileMonitor::Impl::monitorFile()
                if (new_timestamp != timestamp_) {
                        timestamp_ = new_timestamp;
 
-                       unsigned long const new_checksum = lyx::sum(filename_);
+                       unsigned long const new_checksum = sum(filename_);
                        if (new_checksum != checksum_) {
                                checksum_ = new_checksum;
                                changed = true;
@@ -172,3 +179,6 @@ void FileMonitor::Impl::monitorFile()
        if (changed)
                fileChanged_();
 }
+
+} // namespace support
+} // namespace lyx