view libgui/src/octave-adapter/octave-main-thread.cc @ 15224:a44e4a08fc55

perform fewer actions before starting GUI * octave.cc (forced_line_editing, read_history_file, command_line_path, echo_executing_commands, doc_cache_file, exec_path, image_path, info_file, info_program, no_window_system, texi_macros_file): New file-scope static variables. (octave_process_command_line): New function. Process command line and set octave_cmdline_argc, octave_cmdline_argv, forced_line_editing, and read_history_file here, not in octave_initialize_interpreter. (octave_initialize_interpreter): Perform actions for command line options here instead of in command option processing loop in octave_process_command_line. (octave_main): Call octave_process_command_line. * octave.h (octave_process_command_line): Provide decl. * main.cc, main-cli.cc (main): Call octave_process_command_line. * main.cc (main): If not starting GUI, call octave_initialize_interpreter before calling octave_execute_interpreter. * main-cli.cc (main): Call octave_initialize_interpreter before calling octave_execute_interpreter. * octave-main-thread.cc (octave_main_thread::run): Likewise.
author John W. Eaton <jwe@octave.org>
date Thu, 23 Aug 2012 17:53:42 -0400
parents 359098ad343e
children 80e99730e5d4
line wrap: on
line source

/*

Copyright (C) 2011-2012 Jacob Dawid

This file is part of Octave.

Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.

Octave is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with Octave; see the file COPYING.  If not, see
<http://www.gnu.org/licenses/>.

*/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <string>

#include "octave.h"

#include "octave-main-thread.h"
#include "octave-link.h"

octave_main_thread::octave_main_thread () : QThread ()
{
}

void
octave_main_thread::run ()
{
  setlocale (LC_ALL, "en_US.UTF-8");

  emit ready ();

  octave_initialize_interpreter (octave_cmdline_argc, octave_cmdline_argv,
                                 octave_embedded);

  octave_execute_interpreter ();
}