comparison libgui/src/m-editor/file-editor.cc @ 20296:23fb65b45d8c

do not call custom editor at startup and when debugging (bug #44701) * file-editor.cc (call_custom_editor): return with true but without opening a file; (empty_script): do not open an empty script in the cutom editor at startup
author Torsten <ttl@justmail.de>
date Fri, 17 Apr 2015 19:55:24 +0200
parents 17d79913f065
children
comparison
equal deleted inserted replaced
20295:c58cf3a65519 20296:23fb65b45d8c
270 // Check if the user wants to use a custom file editor. 270 // Check if the user wants to use a custom file editor.
271 QSettings *settings = resource_manager::get_settings (); 271 QSettings *settings = resource_manager::get_settings ();
272 272
273 if (settings->value ("useCustomFileEditor",false).toBool ()) 273 if (settings->value ("useCustomFileEditor",false).toBool ())
274 { 274 {
275 if (line > -1) // check for a specific line (debugging)
276 return true; // yes: do ont open a file in external editor
277
275 QString editor = settings->value ("customFileEditor").toString (); 278 QString editor = settings->value ("customFileEditor").toString ();
276 editor.replace ("%f", file_name); 279 editor.replace ("%f", file_name);
277 editor.replace ("%l", QString::number (line)); 280 editor.replace ("%l", QString::number (line));
278 281
279 bool started_ok = QProcess::startDetached (editor); 282 bool started_ok = QProcess::startDetached (editor);
1914 // (Here we can not use the visibility changed signal) 1917 // (Here we can not use the visibility changed signal)
1915 // 2. When the editor becomes visible when octave is running 1918 // 2. When the editor becomes visible when octave is running
1916 void 1919 void
1917 file_editor::empty_script (bool startup, bool visible) 1920 file_editor::empty_script (bool startup, bool visible)
1918 { 1921 {
1922 QSettings *settings = resource_manager::get_settings ();
1923 if (settings->value ("useCustomFileEditor",false).toBool ())
1924 return; // do not open an empty script in the external editor
1925
1919 bool real_visible; 1926 bool real_visible;
1920 1927
1921 if (startup) 1928 if (startup)
1922 real_visible = isVisible (); 1929 real_visible = isVisible ();
1923 else 1930 else