]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsCacheItem.cpp
C++11 supports thread-safe initialization of statics
[lyx.git] / src / graphics / GraphicsCacheItem.cpp
index 0b262ad24126d966a195e96f4263051b66d35a10..ea59173eff79bc93588ed18373b7c167965f4a68 100644 (file)
@@ -26,6 +26,7 @@
 #include "support/filetools.h"
 #include "support/FileMonitor.h"
 #include "support/lassert.h"
+#include "support/unique_ptr.h"
 
 #include "support/bind.h"
 #include "support/TempFile.h"
@@ -37,7 +38,7 @@ namespace lyx {
 
 namespace graphics {
 
-class CacheItem::Impl : public boost::signals::trackable {
+class CacheItem::Impl : public boost::signals2::trackable {
 public:
 
        ///
@@ -114,10 +115,10 @@ public:
        ImageStatus status_;
 
        /// This signal is emitted when the image loading status changes.
-       boost::signal<void()> statusChanged;
+       boost::signals2::signal<void()> statusChanged;
 
        /// The connection of the signal ConvProcess::finishedConversion,
-       boost::signals::connection cc_;
+       boost::signals2::connection cc_;
 
        ///
        unique_ptr<Converter> converter_;
@@ -192,7 +193,7 @@ ImageStatus CacheItem::status() const
 }
 
 
-boost::signals::connection CacheItem::connect(slot_type const & slot) const
+boost::signals2::connection CacheItem::connect(slot_type const & slot) const
 {
        return pimpl_->statusChanged.connect(slot);
 }
@@ -437,7 +438,8 @@ void CacheItem::Impl::convertToDisplayFormat()
        // Connect a signal to this->imageConverted and pass this signal to
        // the graphics converter so that we can load the modified file
        // on completion of the conversion process.
-       converter_.reset(new Converter(filename, to_file_base.absFileName(), from, to_));
+       converter_ = make_unique<Converter>(filename, to_file_base.absFileName(),
+                                           from, to_);
        converter_->connect(bind(&Impl::imageConverted, this, _1));
        converter_->startConversion();
 }