]> git.lyx.org Git - features.git/commitdiff
* Buffer.cpp:
authorJürgen Spitzmüller <spitz@lyx.org>
Sun, 21 Jun 2009 09:44:10 +0000 (09:44 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sun, 21 Jun 2009 09:44:10 +0000 (09:44 +0000)
- make LaTeX logfile dialog work for child documents and master-buffer-[view|update]:
  if there's only a master file log or if the master file log is newer, it is displayed.
* Buffer.h: typo.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30206 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/Buffer.h

index 481a7c6ab40342d4fdd50299beb319934d554eb1..b7b27c4073d6e5316dbe56d0a0e8126d454524d3 100644 (file)
@@ -467,14 +467,31 @@ string Buffer::logName(LogType * type) const
                        changeExtension(filename,
                                        formats.extension(bufferFormat()) + ".out"))));
 
-       // If no Latex log or Build log is newer, show Build log
+       // Also consider the master buffer log file
+       FileName masterfname = fname;
+       LogType mtype;
+       if (masterBuffer() != this) {
+               string const mlogfile = masterBuffer()->logName(&mtype);
+               masterfname = FileName(mlogfile);
+       }
 
+       // If no Latex log or Build log is newer, show Build log
        if (bname.exists() &&
-           (!fname.exists() || fname.lastModified() < bname.lastModified())) {
+           ((!fname.exists() && !masterfname.exists())
+            || (fname.lastModified() < bname.lastModified()
+                && masterfname.lastModified() < bname.lastModified()))) {
                LYXERR(Debug::FILES, "Log name calculated as: " << bname);
                if (type)
                        *type = buildlog;
                return bname.absFilename();
+       // If we have a newer master file log or only a master log, show this
+       } else if (fname != masterfname
+                  && (!fname.exists() && masterfname.exists()
+                  || fname.lastModified() < masterfname.lastModified())) {
+               LYXERR(Debug::FILES, "Log name calculated as: " << masterfname);
+               if (type)
+                       *type = mtype;
+               return masterfname.absFilename();
        }
        LYXERR(Debug::FILES, "Log name calculated as: " << fname);
        if (type)
index 74c378cadc49bacb2e687f099f374f24a2fe5677..72c0d8ca097271162bb5ef0075619fe22dff9870 100644 (file)
@@ -283,7 +283,7 @@ public:
        */
        std::string latexName(bool no_path = true) const;
 
-       /// Get thee name and type of the log.
+       /// Get the name and type of the log.
        std::string logName(LogType * type = 0) const;
 
        /// Change name of buffer. Updates "read-only" flag.