]> git.lyx.org Git - lyx.git/blobdiff - src/support/Systemcall.cpp
TR1: check in cmake for GCC version, fallback in checktr1.h for other build systems...
[lyx.git] / src / support / Systemcall.cpp
index b9d08da28bbd683585a67ba9915e30a5953ee327..98d8d125dea618b29523f795670bb042f8b410d3 100644 (file)
@@ -61,6 +61,10 @@ public:
        void appendMessage(QString const &) {}
        void appendError(QString const &) {}
        void clearMessages() {}
+       void lyxerrFlush() {}
+
+       void lyxerrConnect() {}
+       void lyxerrDisconnect() {}
 
        void warning(QString const &, QString const &) {}
        void toggleWarning(QString const &, QString const &, QString const &) {}
@@ -348,12 +352,19 @@ void SystemcallPrivate::flush()
                // If the output has been redirected, we write it all at once.
                // Even if we are not running in a terminal, the output could go
                // to some log file, for example ~/.xsession-errors on *nix.
-               if (!os::is_terminal(os::STDOUT) && outfile.empty())
-                       cout << fromqstr(QString::fromLocal8Bit(
-                                               proc_->readAllStandardOutput().data()));
-               if (!os::is_terminal(os::STDERR))
-                       cerr << fromqstr(QString::fromLocal8Bit(
-                                               proc_->readAllStandardError().data()));
+               
+               QString data = QString::fromLocal8Bit(proc_->readAllStandardOutput().data());
+               if (showout_) 
+                       ProgressInterface::instance()->appendMessage(data);
+               if (!os::is_terminal(os::STDOUT) && outfile.empty()) 
+                       cout << fromqstr(data);
+               
+               data = QString::fromLocal8Bit(proc_->readAllStandardError().data());
+               if (showerr_) 
+                       ProgressInterface::instance()->appendError(data);
+               if (!os::is_terminal(os::STDERR)) 
+                       cerr << fromqstr(data);                 
+               
        }
 }
 
@@ -368,17 +379,13 @@ void SystemcallPrivate::stdOut()
                        if (c == '\n' || outindex_ + 1 == bufsize_) {
                                outdata_[outindex_] = '\0';
                                outindex_ = 0;
-                               if (showout_)
+                               if (showout_) {
                                        cout << outdata_;
+                                       ProgressInterface::instance()->appendMessage(QString::fromLocal8Bit(outdata_));         
+                               }
                        }
                }
        }
-       const QString data = QString::fromLocal8Bit(outdata_);
-       if (!data.isEmpty()) {
-               // TODO No good messages from the processes. Disable batch mode?
-               //ProgressInterface::instance()->appendMessage(data);
-       }
-       processEvents();
 }
 
 
@@ -392,16 +399,13 @@ void SystemcallPrivate::stdErr()
                        if (c == '\n' || errindex_ + 1 == bufsize_) {
                                errdata_[errindex_] = '\0';
                                errindex_ = 0;
-                               if (showerr_)
+                               if (showerr_) {
                                        cerr << errdata_;
+                                       ProgressInterface::instance()->appendError(QString::fromLocal8Bit(errdata_));
+                               }
                        }
                }
        }
-       const QString data = QString::fromLocal8Bit(errdata_);
-       if (!data.isEmpty()) {
-               ProgressInterface::instance()->appendError(data);
-       }
-       processEvents();
 }