]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsLoader.C
The std::string mammoth path.
[lyx.git] / src / graphics / GraphicsLoader.C
index cba47a8f44e51a016c86bbd101a209967b223f69..5567841954476623ecd5cd2417ba6f07c78e3b59 100644 (file)
@@ -5,31 +5,30 @@
  *
  * \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 "GraphicsLoader.h"
 
-#include "GraphicsCache.h"
 #include "GraphicsCacheItem.h"
 #include "GraphicsImage.h"
 #include "GraphicsParams.h"
 #include "LoaderQueue.h"
 
-#include "frontends/LyXView.h"
-
 #include <boost/bind.hpp>
-#include <boost/signals/trackable.hpp>
 
-#include <list>
 
-namespace grfx {
+using std::string;
+
+
+namespace lyx {
+namespace graphics {
 
 struct Loader::Impl : boost::signals::trackable {
        ///
-       Impl(Params const &);
+       Impl();
        ///
        ~Impl();
        ///
@@ -62,38 +61,50 @@ private:
 
        ///
        Params params_;
-
 };
 
 
 Loader::Loader()
-       : pimpl_(new Impl(Params()))
+       : pimpl_(new Impl)
 {}
 
 
 Loader::Loader(string const & file, DisplayType type)
-       : pimpl_(new Impl(Params()))
+       : pimpl_(new Impl)
 {
        reset(file, type);
 }
 
 
 Loader::Loader(string const & file, Params const & params)
-       : pimpl_(new Impl(params))
+       : pimpl_(new Impl)
 {
        reset(file, params);
 }
 
 
 Loader::Loader(Loader const & other)
-       : pimpl_(new Impl(other.pimpl_->params()))
-{}
+       : pimpl_(new Impl)
+{
+       Params const & params = other.pimpl_->params();
+       reset(params.filename, params);
+}
 
 
 Loader::~Loader()
 {}
 
 
+Loader & Loader::operator=(Loader const & other)
+{
+       if (this != &other) {
+               Params const & params = other.pimpl_->params();
+               reset(params.filename, params);
+       }
+       return *this;
+}
+
+
 void Loader::reset(string const & file, DisplayType type) const
 {
        Params params;
@@ -181,8 +192,8 @@ Image const * Loader::image() const
 }
 
 
-Loader::Impl::Impl(Params const & params)
-       : status_(WaitingToLoad), params_(params)
+Loader::Impl::Impl()
+       : status_(WaitingToLoad)
 {
 }
 
@@ -274,7 +285,6 @@ void Loader::Impl::createPixmap()
        }
 }
 
-
 void Loader::Impl::startLoading()
 {
        if (status_ != WaitingToLoad)
@@ -284,4 +294,5 @@ void Loader::Impl::startLoading()
 }
 
 
-} // namespace grfx
+} // namespace graphics
+} // namespace lyx