Mercurial > hg > octave-nkf
diff libgui/src/octave-qt-link.cc @ 16420:81ec95768520
use octave-link instead of hook for edit function
* octave-main-thread.cc (edit_hook_fcn): Delete.
(octave_main_thread::run): Don't install callback function for edit
function.
* octave-qt-link.h, octave-qt-link.cc (octave_qt_link::do_edit_file):
Pass file as string instead of octave_value_list. Return status.
* interpfcn/octave-link.h, interpfcn/octave-link.cc: Move here from
interp-core directory.
* libinterp/interp-core/module.mk, libinterp/interpfcn/module.mk:
Update file lists.
* octave-link.h: Don't include oct-obj.h.
(octave_link::edit_file, octave_link::do_edit_file): Return bool.
* octave-link.cc (F__octave_link_edit_file__): New function.
* edit.m: Call __octave_link_edit_file__ instead of
__execute_edit_hook__.
* __execute_edit_hook__.cc: Delete
* libinterp/corefcn/module.mk (COREFCN_SRC): Remove it from the list.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 03 Apr 2013 23:16:37 -0400 |
parents | 16bfbf9136d3 |
children | 436f6e0e4268 |
line wrap: on
line diff
--- a/libgui/src/octave-qt-link.cc +++ b/libgui/src/octave-qt-link.cc @@ -122,25 +122,19 @@ } } -void -octave_qt_link::do_edit_file (const octave_value_list& args) +bool +octave_qt_link::do_edit_file (const std::string& file) { + bool retval = false; + if (event_listener) { - if (args.length () == 1) - { - std::string file = args(0).string_value (); + event_listener->edit_file (file); - if (! error_state) - { - event_listener->edit_file (file); - do_process_events (); + do_process_events (); - } - else - ::error ("expecting file name in edit file callback"); - } - else - ::error ("invalid call to edit file callback"); + retval = true; } + + return retval; }