]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsCache.cpp
Remove obsolete (and false) comment.
[lyx.git] / src / graphics / GraphicsCache.cpp
index d36de0fbe260257bf88627a8efffe74dd691bc69..dbf9cafa5e93d0e14ccbefce7ab646280947cbfa 100644 (file)
 
 #include "Format.h"
 
+#include "frontends/Application.h"
+
 #include "support/debug.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
-#include "support/imagetools.h"
 
 #include <map>
 
@@ -70,12 +71,12 @@ vector<string> const & Cache::loadableFormats() const
                return fmts;
 
        // The formats recognised by LyX
-       Formats::const_iterator begin = formats.begin();
-       Formats::const_iterator end   = formats.end();
+       Formats::const_iterator begin = theFormats().begin();
+       Formats::const_iterator end   = theFormats().end();
 
        // The formats natively loadable.
-       vector<string> nformat = loadableImageFormats();
-       
+       vector<string> nformat = frontend::loadableImageFormats();
+
        vector<string>::const_iterator it = nformat.begin();
        for (; it != nformat.end(); ++it) {
                for (Formats::const_iterator fit = begin; fit != end; ++fit) {
@@ -92,18 +93,15 @@ vector<string> const & Cache::loadableFormats() const
                vector<string>::const_iterator fbegin = fmts.begin();
                vector<string>::const_iterator fend = fmts.end();
                for (vector<string>::const_iterator fit = fbegin; fit != fend; ++fit) {
-                       if (fit != fbegin)
-                               LYXERR(Debug::GRAPHICS, ", ");
-                       LYXERR(Debug::GRAPHICS, *fit);
+                       LYXERR(Debug::GRAPHICS, *fit << ',');
                }
-               LYXERR(Debug::GRAPHICS, '\n');
        }
 
        return fmts;
 }
 
 
-void Cache::add(FileName const & file) const
+void Cache::add(FileName const & file, FileName const & doc_file) const
 {
        // Is the file in the cache already?
        if (inCache(file)) {
@@ -112,7 +110,7 @@ void Cache::add(FileName const & file) const
                return;
        }
 
-       pimpl_->cache[file] = ItemPtr(new CacheItem(file));
+       pimpl_->cache[file] = ItemPtr(new CacheItem(file, doc_file));
 }