]> git.lyx.org Git - lyx.git/commitdiff
Be more specific that 'using lyx::support'.
authorAngus Leeming <leeming@lyx.org>
Thu, 4 Sep 2003 00:29:22 +0000 (00:29 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 4 Sep 2003 00:29:22 +0000 (00:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7653 a592a061-630c-0410-9148-cb99ea01b6c8

src/graphics/ChangeLog
src/graphics/GraphicsCache.C
src/graphics/GraphicsCacheItem.C
src/graphics/GraphicsConverter.C
src/graphics/PreviewImage.C
src/graphics/PreviewLoader.C
src/graphics/PreviewedInset.C
src/graphics/Previews.C
src/graphics/Previews.h

index 9f82eb3abece29de60ce08a430cd64f7d873438b..f99f0f46a868cba2aa45a94dee0428d83b65b690 100644 (file)
@@ -1,3 +1,16 @@
+2003-09-04  Angus Leeming  <leeming@lyx.org>
+
+       * GraphicsCache.C:
+       * GraphicsCacheItem.C:
+       * GraphicsConverter.C:
+       * PreviewImage.C:
+       * PreviewLoader.C:
+       * PreviewedInset.C:
+       * Previews.C: 'namespace support = lyx::support' rather than
+       'using lyx::support'.
+
+       * Previews.h: cleaned up some comments.
+
 2003-07-26  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * GraphicsTypes.h: do not declare displayTranstor here (and remove
index 04819cec97f78ffd0eaf27519422da986438e242..a220462f543ea86f7c89efccd78a16f5be78ded9 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <map>
 
-using namespace lyx::support;
+namespace support = lyx::support;
 
 namespace lyx {
 namespace graphics {
@@ -64,7 +64,7 @@ std::vector<string> Cache::loadableFormats() const
 
 void Cache::add(string const & file) const
 {
-       if (!AbsolutePath(file)) {
+       if (!support::AbsolutePath(file)) {
                lyxerr << "Cache::add(" << file << "):\n"
                       << "The file must be have an absolute path."
                       << std::endl;
index 9241560176e201d871459d1dfd1fc1f28d715794..7fc4f801ebf2d3db3b4b4287559b818c34346a7b 100644 (file)
 #include <boost/bind.hpp>
 #include <boost/signals/trackable.hpp>
 
-using namespace lyx::support;
+namespace support = lyx::support;
+
+using support::Assert;
+using support::ChangeExtension;
+using support::FileMonitor;
+using support::IsFileReadable;
+using support::MakeDisplayPath;
+using support::OnlyFilename;
+using support::getExtFromContents;
+using support::tempName;
+using support::unlink;
+using support::unzipFile;
+using support::zippedFile;
 
 using std::endl;
 
index 3496c145e4210edfdfe2c3775eff3293a0c34d59..13b4b91206c64c52c810ddd7279bc3c0388a42da 100644 (file)
 #include <fstream>
 #include <sys/types.h> // needed for pid_t
 
-using namespace lyx::support;
+namespace support = lyx::support;
+
+using support::ChangeExtension;
+using support::Forkedcall;
+using support::ForkedCallQueue;
+using support::LibFileSearch;
+using support::LibScriptSearch;
+using support::OnlyPath;
+using support::OnlyFilename;
+using support::QuoteName;
+using support::subst;
+using support::tempName;
+using support::unlink;
 
 using std::endl;
 using std::ostream;
index 4a3b9a1ee270b3b2b02977bc17fd8898c1d1f6b7..3fae30b2d76d78c703d638565d363d3ebfb7e8e1 100644 (file)
@@ -20,7 +20,8 @@
 #include <boost/bind.hpp>
 #include <boost/signals/trackable.hpp>
 
-using namespace lyx::support;
+namespace support = lyx::support;
+
 
 namespace lyx {
 namespace graphics {
@@ -114,7 +115,7 @@ PreviewImage::Impl::Impl(PreviewImage & p, PreviewLoader & l,
 
 PreviewImage::Impl::~Impl()
 {
-       unlink(iloader_.filename());
+       support::unlink(iloader_.filename());
 }
 
 
@@ -147,7 +148,7 @@ void PreviewImage::Impl::statusChanged()
                break;
 
        case Ready:
-               unlink(iloader_.filename());
+               support::unlink(iloader_.filename());
                ploader_.emitSignal(parent_);
                break;
        }
index 2e96ca3f4313621d972a47b052b054327f0ecc13..9af42478deb5ba7907efd205566271e9e25442c1 100644 (file)
@@ -42,7 +42,8 @@
 #include <utility>
 #include <vector>
 
-using namespace lyx::support;
+namespace support = lyx::support;
+
 
 using std::endl;
 using std::find;
@@ -292,16 +293,16 @@ InProgress::InProgress(string const & filename_base,
 void InProgress::stop() const
 {
        if (pid)
-               ForkedcallsController::get().kill(pid, 0);
+               support::ForkedcallsController::get().kill(pid, 0);
 
        if (!metrics_file.empty())
-               unlink(metrics_file);
+               support::unlink(metrics_file);
 
        BitmapFile::const_iterator vit  = snippets.begin();
        BitmapFile::const_iterator vend = snippets.end();
        for (; vit != vend; ++vit) {
                if (!vit->second.empty())
-                       unlink(vit->second);
+                       support::unlink(vit->second);
        }
 }
 
@@ -393,7 +394,7 @@ void PreviewLoader::Impl::add(string const & latex_snippet)
        if (!pconverter_ || status(latex_snippet) != NotFound)
                return;
 
-       string const snippet = trim(latex_snippet);
+       string const snippet = support::trim(latex_snippet);
        if (snippet.empty())
                return;
 
@@ -486,14 +487,15 @@ void PreviewLoader::Impl::startLoading()
        cs << pconverter_->command << ' ' << latexfile << ' '
           << int(font_scaling_factor_) << ' ' << pconverter_->to;
 
-       string const command = "sh " + LibScriptSearch(STRCONV(cs.str()));
+       string const command = "sh " + support::LibScriptSearch(STRCONV(cs.str()));
 
        // Initiate the conversion from LaTeX to bitmap images files.
-       Forkedcall::SignalTypePtr convert_ptr(new Forkedcall::SignalType);
+       support::Forkedcall::SignalTypePtr
+               convert_ptr(new support::Forkedcall::SignalType);
        convert_ptr->connect(
                boost::bind(&Impl::finishedGenerating, this, _1, _2));
 
-       Forkedcall call;
+       support::Forkedcall call;
        int ret = call.startscript(command, convert_ptr);
 
        if (ret != 0) {
@@ -649,7 +651,7 @@ string const unique_filename(string const bufferpath)
 {
        static int theCounter = 0;
        string const filename = tostr(theCounter++) + "lyxpreview";
-       return AddName(bufferpath, filename);
+       return support::AddName(bufferpath, filename);
 }
 
 
@@ -746,7 +748,7 @@ void setAscentFractions(vector<double> & ascent_fractions,
                        double const a = ascent + tp_ascent;
                        double const d = descent - tp_descent;
 
-                       if (!float_equal(a + d, 0, 0.1))
+                       if (!support::float_equal(a + d, 0, 0.1))
                                *it = a / (a + d);
 
                        if (++it == end)
index 52741234878f4205e4c5b090570d5cf615d50f76..258c6f0417bf16885b45f2e0e0d06e97f917a425 100644 (file)
@@ -25,9 +25,8 @@
 
 #include <boost/bind.hpp>
 
-#include "debug.h"    // temporary
+namespace support = lyx::support;
 
-using namespace lyx::support;
 
 namespace lyx {
 namespace graphics {
@@ -63,7 +62,7 @@ void PreviewedInset::addPreview(PreviewLoader & ploader)
        if (!Previews::activated() || !previewWanted())
                return;
 
-       snippet_ = trim(latexString());
+       snippet_ = support::trim(latexString());
        if (snippet_.empty())
                return;
 
index 0cbd21b39847aed4c137da5cee547685de64fcc4..e8c64b98868ccec36f7647fac70051751ffc38eb 100644 (file)
 
 #include <map>
 
-namespace lyx {
+namespace support = lyx::support;
 
-using namespace lyx::support;
 
+namespace lyx {
 namespace graphics {
 
 bool Previews::activated()
index 630b49f8140ff7e6c349aa4b919b4b2e070552cc..1f9430d984679bf99f42331d00c72005175e1fb4 100644 (file)
@@ -36,20 +36,15 @@ public:
 
        /** Returns the PreviewLoader for this buffer.
         *  Used by individual insets to update their own preview.
-        *  We assert that (buffer != 0) but do not pass a Buffer &
-        *  so that insets do not need to #include buffer.h
         */
        PreviewLoader & loader(Buffer const & buffer) const;
 
-       /** Called from the Buffer d-tor.
-        *  If (buffer == 0), does nothing.
-        */
+       /// Called from the Buffer d-tor.
        void removeLoader(Buffer const & buffer) const;
 
        /** For a particular buffer, initiate the generation of previews
-        *  for each and every snippetof LaTeX that's of interest with
+        *  for each and every snippet of LaTeX that's of interest with
         *  a single forked process.
-        *  If (buffer == 0), does nothing.
         */
        void generateBufferPreviews(Buffer const & buffer) const;
 
@@ -58,7 +53,6 @@ private:
         *  are instantiated.
         */
        Previews();
-       ///
        ~Previews();
 
        /// Use the Pimpl idiom to hide the internals.