]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_cb.C
This commit saves the need to check for lyx::use_gui in a number of places.
[lyx.git] / src / lyx_cb.C
index 341aa45c36dc145d54d6218cdb0ec120914ae4d3..d849b4b380746a9700d1b02e786501807e1e63bf 100644 (file)
@@ -34,7 +34,6 @@
 #include "frontends/Alert.h"
 #include "frontends/Application.h"
 #include "frontends/FileDialog.h"
-#include "frontends/lyx_gui.h"
 
 #include "support/filefilterlist.h"
 #include "support/filetools.h"
@@ -94,7 +93,6 @@ using std::istream_iterator;
 // this should be static, but I need it in buffer.C
 bool quitting; // flag, that we are quitting the program
 
-
 //
 // Menu callbacks
 //
@@ -192,8 +190,8 @@ void quitLyX(bool noask)
 {
        lyxerr[Debug::INFO] << "Running QuitLyX." << endl;
 
-       if (lyx_gui::use_gui) {
-               if (!noask && !theApp->bufferList().quitWriteAll())
+       if (lyx::use_gui) {
+               if (!noask && !theBufferList().quitWriteAll())
                        return;
 
                LyX::cref().session().writeFile();
@@ -204,7 +202,7 @@ void quitLyX(bool noask)
        quitting = true;
 
        // close buffers first
-       theApp->bufferList().closeAll();
+       theBufferList().closeAll();
 
        // do any other cleanup procedures now
        lyxerr[Debug::INFO] << "Deleting tmp dir " << package().temp_dir() << endl;
@@ -216,9 +214,12 @@ void quitLyX(bool noask)
                Alert::warning(_("Unable to remove temporary directory"), msg);
        }
 
-       theApp->exit(0);
-       // Restore original font resources after Application is destroyed.
-       lyx::support::restoreFontResources();
+       if (lyx::use_gui) {
+               theApp->exit(0);
+
+               // Restore original font resources after Application is destroyed.
+               lyx::support::restoreFontResources();
+       }
 }