]> git.lyx.org Git - features.git/commitdiff
get rid of dead code and silly function
authorGeorg Baum <georg.baum@post.rwth-aachen.de>
Thu, 12 Jan 2012 19:48:08 +0000 (19:48 +0000)
committerGeorg Baum <georg.baum@post.rwth-aachen.de>
Thu, 12 Jan 2012 19:48:08 +0000 (19:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40605 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/FileName.cpp
src/support/FileName.h
src/support/filetools.cpp

index a0ad86da69db98f054a28fada191287c8d7de0b9..4daa3647366d5590da79e7787c2ec57a78f89158 100644 (file)
@@ -1054,12 +1054,12 @@ DocFileName::DocFileName()
 
 
 DocFileName::DocFileName(string const & abs_filename, bool save_abs)
-       : FileName(abs_filename), save_abs_path_(save_abs), zipped_valid_(false)
+       : FileName(abs_filename), save_abs_path_(save_abs)
 {}
 
 
 DocFileName::DocFileName(FileName const & abs_filename, bool save_abs)
-       : FileName(abs_filename), save_abs_path_(save_abs), zipped_valid_(false)
+       : FileName(abs_filename), save_abs_path_(save_abs)
 {}
 
 
@@ -1070,14 +1070,12 @@ void DocFileName::set(string const & name, string const & buffer_path)
                FileName::set(name);
        else
                FileName::set(makeAbsPath(name, buffer_path).absFileName());
-       zipped_valid_ = false;
 }
 
 
 void DocFileName::erase()
 {
        FileName::erase();
-       zipped_valid_ = false;
 }
 
 
@@ -1156,16 +1154,6 @@ string DocFileName::mangledFileName(string const & dir) const
 }
 
 
-bool DocFileName::isZipped() const
-{
-       if (!zipped_valid_) {
-               zipped_ = isZippedFile();
-               zipped_valid_ = true;
-       }
-       return zipped_;
-}
-
-
 string DocFileName::unzippedFileName() const
 {
        return support::unzippedFileName(absFileName());
index 23e6fd0d408a9e6625b7ac7589676ba119951657..da1f75fbeedd53f24dea218238e7e3cb71a7493d 100644 (file)
@@ -290,8 +290,6 @@ public:
        std::string
        mangledFileName(std::string const & dir = empty_string()) const;
 
-       /// \return true if the file is compressed.
-       bool isZipped() const;
        /// \return the absolute file name without its .gz, .z, .Z extension
        std::string unzippedFileName() const;
 
@@ -299,10 +297,6 @@ private:
        /// Records whether we should save (or export) the filename as a relative
        /// or absolute path.
        bool save_abs_path_;
-       /// Cache for isZipped() because zippedFile() is expensive
-       mutable bool zipped_;
-       /// Is zipped_ valid?
-       mutable bool zipped_valid_;
 };
 
 
index 5891e79fec62c6b89346ed3e611a265e8a7bc1ca..0dcb2edc575ff7ad0c83d137b28faf47f3b23d31 100644 (file)
@@ -1016,16 +1016,6 @@ FileName const findtexfile(string const & fil, string const & /*format*/)
 }
 
 
-void readBB_lyxerrMessage(FileName const & file, bool & zipped,
-       string const & message)
-{
-       LYXERR(Debug::GRAPHICS, "[readBB_from_PSFile] " << message);
-       // FIXME: Why is this func deleting a file? (Lgb)
-       if (zipped)
-               file.removeFile();
-}
-
-
 string const readBB_from_PSFile(FileName const & file)
 {
        // in a (e)ps-file it's an entry like %%BoundingBox:23 45 321 345
@@ -1040,7 +1030,9 @@ string const readBB_from_PSFile(FileName const & file)
        string const format = file_.guessFormatFromContents();
 
        if (format != "eps" && format != "ps") {
-               readBB_lyxerrMessage(file_, zipped,"no(e)ps-format");
+               LYXERR(Debug::GRAPHICS, "[readBB_from_PSFile] no(e)ps-format");
+               if (zipped)
+                       file_.removeFile();
                return string();
        }
 
@@ -1060,11 +1052,15 @@ string const readBB_from_PSFile(FileName const & file)
                        os << what.str(1) << ' ' << what.str(2) << ' '
                           << what.str(3) << ' ' << what.str(4);
                        string const bb = os.str();
-                       readBB_lyxerrMessage(file_, zipped, bb);
+                       LYXERR(Debug::GRAPHICS, "[readBB_from_PSFile] " << bb);
+                       if (zipped)
+                               file_.removeFile();
                        return bb;
                }
        }
-       readBB_lyxerrMessage(file_, zipped, "no bb found");
+       LYXERR(Debug::GRAPHICS, "[readBB_from_PSFile] no bb found");
+       if (zipped)
+               file_.removeFile();
        return string();
 }