]> git.lyx.org Git - lyx.git/blobdiff - src/support/FileMonitor.cpp
Fix import of latex documents with scaled fonts.
[lyx.git] / src / support / FileMonitor.cpp
index 6ec87a738e345295e79c998b28388a94a5413d5c..9f959d5a3a5bac557917ab38f1bbf758cb8c1ea8 100644 (file)
 #include <config.h>
 
 #include "support/FileMonitor.h"
+
 #include "support/FileName.h"
-#include "support/lyxlib.h"
 #include "support/Timeout.h"
 
-#include <boost/bind.hpp>
+#include "support/bind.h"
 #include <boost/signals/trackable.hpp>
 
-
-using std::string;
+using namespace std;
 
 namespace lyx {
 namespace support {
@@ -57,7 +56,9 @@ FileMonitor::FileMonitor(FileName const & file_with_path, int interval)
 
 
 FileMonitor::~FileMonitor()
-{}
+{
+       delete pimpl_;
+}
 
 
 void FileMonitor::reset(FileName const & file_with_path) const
@@ -91,7 +92,7 @@ void FileMonitor::start() const
                return;
 
        pimpl_->timestamp_ = pimpl_->filename_.lastModified();
-       pimpl_->checksum_ = sum(pimpl_->filename_);
+       pimpl_->checksum_ = pimpl_->filename_.checksum();
 
        if (pimpl_->timestamp_ && pimpl_->checksum_) {
                pimpl_->timer_.start();
@@ -121,7 +122,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 sum(pimpl_->filename_);
+               return pimpl_->filename_.checksum();
 
        return pimpl_->checksum_;
 }
@@ -144,7 +145,7 @@ FileMonitor::Impl::Impl(FileName const & file_with_path, int interval)
          timestamp_(0),
          checksum_(0)
 {
-       timer_.timeout.connect(boost::bind(&Impl::monitorFile, this));
+       timer_.timeout.connect(bind(&Impl::monitorFile, this));
 }
 
 
@@ -163,7 +164,7 @@ void FileMonitor::Impl::monitorFile()
                if (new_timestamp != timestamp_) {
                        timestamp_ = new_timestamp;
 
-                       unsigned long const new_checksum = sum(filename_);
+                       unsigned long const new_checksum = filename_.checksum();
                        if (new_checksum != checksum_) {
                                checksum_ = new_checksum;
                                changed = true;