]> git.lyx.org Git - features.git/commitdiff
avoid closing server in emergency exit if there is no server
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 14 Nov 2001 12:00:51 +0000 (12:00 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 14 Nov 2001 12:00:51 +0000 (12:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3028 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/ColorHandler.C
src/lyxrc.C
src/lyxserver.C

index 085c6d56163e513523dcaf4e39a47762c42daae9..8d2bc1796742ce8ed84e9adb1449033b2182a3a5 100644 (file)
@@ -1,6 +1,15 @@
 2001-11-14  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
-       * lyxrc.C (read): 
+       * lyxserver.C (emergencyCleanup): do not try to close pipes if
+       server is not running.
+       (openConnection): 
+       (closeConnection): add debug info when server is disabled.
+
+       * ColorHandler.C (getGCForeground): send debug message to GUI
+       channel. 
+
+       * lyxrc.C: do not include lyxserver.h and tex-strings.h.
+
        * kbmap.C (bind): modify because return conventions of
        kb_sequence::parse have changed.
 
index fcd516610e6a08cdbcf71a431bf3b457d75d6a8d..95912c522592b3c781e8812680eb44e7793bf479 100644 (file)
@@ -88,7 +88,7 @@ GC LyXColorHandler::getGCForeground(LColor::color c)
                val.foreground = bla;
        // Try the exact RGB values first, then the approximate.
        } else if (XAllocColor(display, colormap, &xcol) != 0) {
-               if (lyxerr.debugging()) {
+               if (lyxerr.debugging(Debug::GUI)) {
                        lyxerr << _("LyX: X11 color ") << s
                               << _(" allocated for ") 
                               << lcolor.getGUIName(c) << endl;
index c93b33729a6d23d78bb00c3e036466011152f912..cd89f42206781332f4a6d6a7e6c132dff46cb9b4 100644 (file)
 #include "lyxrc.h"
 #include "kbmap.h"
 #include "LyXAction.h"
-#include "lyxserver.h"
 #include "lyx_main.h"
 #include "intl.h"
-#include "tex-strings.h"
 #include "support/path.h"
 #include "support/filetools.h"
 #include "lyxtext.h"
index 3e16f061389964d1d8574028a98af5e0d31460f3..368e6df9ad1c2f13a19524044a3b0c0fcc553ee3 100644 (file)
@@ -108,7 +108,12 @@ void LyXComm::openConnection()
        // We assume that we don't make it
        ready = false;
  
-       if (pipename.empty()) return;
+       if (pipename.empty()) {
+               lyxerr[Debug::LYXSERVER]
+                       << "LyXComm: server is disabled, nothing to do"
+                       << endl;
+               return;
+       }
 
        if ((infd = startPipe(inPipeName(), false)) == -1)
                return;
@@ -136,6 +141,9 @@ void LyXComm::closeConnection()
                lyxerr[Debug::LYXSERVER] << "LyXComm: Closing connection" << endl;
 
        if (pipename.empty()) {
+               lyxerr[Debug::LYXSERVER]
+                       << "LyXComm: server is disabled, nothing to do"
+                       << endl;
                return;
        }
 
@@ -255,8 +263,10 @@ void LyXComm::endPipe(int & fd, string const & filename)
 
 void LyXComm::emergencyCleanup()
 {
-       endPipe(infd, inPipeName());
-       endPipe(outfd, outPipeName());
+       if (!pipename.empty()) {
+               endPipe(infd, inPipeName());
+               endPipe(outfd, outPipeName());
+       }
 }