X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FFileMonitor.cpp;h=bdd6444ff677e6aa0f0f2759e7240e3d94e692d3;hb=e2bc7ffae3eb387661064be8b9dc927742f9e7e8;hp=1abca468ed05957da488037e0004f601f9bbbb6d;hpb=efbf9fec5ecefc45caf3b9d0c4dba2a4be969b26;p=lyx.git diff --git a/src/support/FileMonitor.cpp b/src/support/FileMonitor.cpp index 1abca468ed..bdd6444ff6 100644 --- a/src/support/FileMonitor.cpp +++ b/src/support/FileMonitor.cpp @@ -13,19 +13,17 @@ #include "support/FileMonitor.h" #include "support/FileName.h" -#include "support/lyxlib.h" #include "support/Timeout.h" -#include -#include +#include "support/bind.h" +#include - -using std::string; +using namespace std; namespace lyx { namespace support { -class FileMonitor::Impl : public boost::signals::trackable { +class FileMonitor::Impl : public boost::signals2::trackable { public: /// @@ -94,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(); @@ -124,13 +122,13 @@ 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_; } -boost::signals::connection FileMonitor::connect(slot_type const & slot) const +boost::signals2::connection FileMonitor::connect(slot_type const & slot) const { return pimpl_->fileChanged_.connect(slot); } @@ -147,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)); } @@ -166,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;