# HG changeset patch # User John W. Eaton # Date 1383113321 14400 # Node ID f3e25230b1f3b35eff7983a4d6e2fb2eadb1367f # Parent f5ada8597078e4ba4e2782a0793d557839e8c9f4 use QCoreApplication if starting with --no-gui * octave-gui.cc (octave_start_gui): Use QApplication when starting the GUI and QCoreApplication if not. (octave_cli_thread::run): Call QCoreApplication::exit instead of QApplication::exit. diff --git a/libgui/src/octave-gui.cc b/libgui/src/octave-gui.cc --- a/libgui/src/octave-gui.cc +++ b/libgui/src/octave-gui.cc @@ -25,6 +25,7 @@ #endif #include +#include #include #include #include @@ -72,7 +73,7 @@ m_result = octave_execute_interpreter (); - QApplication::exit (m_result); + QCoreApplication::exit (m_result); } private: @@ -119,10 +120,10 @@ { qInstallMsgHandler (message_handler); - QApplication application (argc, argv); - if (start_gui) { + QApplication application (argc, argv); + // Set the codec for all strings QTextCodec::setCodecForCStrings (QTextCodec::codecForName ("UTF-8")); @@ -175,9 +176,9 @@ } else { - octave_cli_thread main_thread (argc, argv); + QCoreApplication application (argc, argv); - application.setQuitOnLastWindowClosed (false); + octave_cli_thread main_thread (argc, argv); main_thread.start ();