# HG changeset patch # User John W. Eaton # Date 1366907221 14400 # Node ID 477bfd5d95f5ad98fd536fc9f32370eba2ef81dc # Parent 68176102fe07d5a1061abbf5185aac25421cd712 use dir, not path, to refer to directory name * file-editor-tab.h, file-editor-tab.cc (file_editor_tab::bp_info::dir): Rename from path. Change all uses. (file_editor_tab::run_file): Rename local variable from path to dir. diff --git a/libgui/src/m-editor/file-editor-tab.cc b/libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -370,13 +370,13 @@ save_file (_file_name); QFileInfo file_info (_file_name); - QString path = file_info.absolutePath (); + QString dir = file_info.absolutePath (); QString function_name = file_info.fileName (); // We have to cut off the suffix, because octave appends it. function_name.chop (file_info.suffix ().length () + 1); emit process_octave_code (QString ("cd \'%1\'\n%2\n") - .arg (path).arg (function_name)); + .arg (dir).arg (function_name)); // TODO: Sending a run event crashes for long scripts. Find out why. // octave_link::post_event @@ -449,11 +449,11 @@ std::string curr_dir = octave_env::get_current_directory (); - if (same_file (curr_dir, info.path)) + if (same_file (curr_dir, info.dir)) ok = true; else { - bool dir_in_load_path = load_path::contains_canonical (info.path); + bool dir_in_load_path = load_path::contains_canonical (info.dir); std::string base_file = octave_env::base_pathname (info.file); std::string lp_file = load_path::find_file (base_file); @@ -473,7 +473,7 @@ if (same_file (lp_file, base_file)) { - if (same_file (curr_dir, info.path)) + if (same_file (curr_dir, info.dir)) ok = true; else addpath_option = false; @@ -484,17 +484,17 @@ if (! ok) { int action - = octave_link::debug_cd_or_addpath_error (info.file, info.path, + = octave_link::debug_cd_or_addpath_error (info.file, info.dir, addpath_option); switch (action) { case 1: - Fcd (ovl (info.path)); + Fcd (ovl (info.dir)); ok = true; break; case 2: - load_path::prepend (info.path); + load_path::prepend (info.dir); ok = true; break; @@ -537,13 +537,13 @@ file_editor_tab::request_add_breakpoint (int line) { QFileInfo file_info (_file_name); - QString path = file_info.absolutePath (); + QString dir = file_info.absolutePath (); QString function_name = file_info.fileName (); // We have to cut off the suffix, because octave appends it. function_name.chop (file_info.suffix ().length () + 1); - bp_info info (_file_name, path, function_name, line+1); + bp_info info (_file_name, dir, function_name, line+1); octave_link::post_event (this, &file_editor_tab::add_breakpoint_callback, info); @@ -553,13 +553,13 @@ file_editor_tab::request_remove_breakpoint (int line) { QFileInfo file_info (_file_name); - QString path = file_info.absolutePath (); + QString dir = file_info.absolutePath (); QString function_name = file_info.fileName (); // We have to cut off the suffix, because octave appends it. function_name.chop (file_info.suffix ().length () + 1); - bp_info info (_file_name, path, function_name, line+1); + bp_info info (_file_name, dir, function_name, line+1); octave_link::post_event (this, &file_editor_tab::remove_breakpoint_callback, info); @@ -621,13 +621,13 @@ return; QFileInfo file_info (_file_name); - QString path = file_info.absolutePath (); + QString dir = file_info.absolutePath (); QString function_name = file_info.fileName (); // We have to cut off the suffix, because octave appends it. function_name.chop (file_info.suffix ().length () + 1); - bp_info info (_file_name, path, function_name, 0); + bp_info info (_file_name, dir, function_name, 0); octave_link::post_event (this, &file_editor_tab::remove_all_breakpoints_callback, info); diff --git a/libgui/src/m-editor/file-editor-tab.h b/libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h +++ b/libgui/src/m-editor/file-editor-tab.h @@ -148,13 +148,13 @@ struct bp_info { - bp_info (const QString& f, const QString& p, const QString& fn, int l) - : file (f.toStdString ()), path (p.toStdString ()), + bp_info (const QString& f, const QString& d, const QString& fn, int l) + : file (f.toStdString ()), dir (d.toStdString ()), function_name (fn.toStdString ()), line (l) { } std::string file; - std::string path; + std::string dir; std::string function_name; int line; };