Mercurial > hg > octave-shane
changeset 16568:477bfd5d95f5
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.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 25 Apr 2013 12:27:01 -0400 |
parents | 68176102fe07 |
children | ab1df81adaa0 |
files | libgui/src/m-editor/file-editor-tab.cc libgui/src/m-editor/file-editor-tab.h |
diffstat | 2 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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; };