Mercurial > hg > octave-lojdl
changeset 16740:cfefcc2a4dae
do not save unnamed files for restoring the editor session at next start up
* file-editor.cc(desructor): do not save new, but still unnamed files for
restoring the edtior session next time
author | Torsten <ttl@justmail.de> |
---|---|
date | Sun, 09 Jun 2013 18:55:19 +0200 |
parents | 6960ac6ed127 |
children | 55ba77da26d3 |
files | libgui/src/m-editor/file-editor.cc |
diffstat | 1 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -57,17 +57,19 @@ { QSettings *settings = resource_manager::get_settings (); + // Have all file editor tabs signal what their file names are. editor_tab_map.clear (); + emit fetab_file_name_query (0); - if (settings->value ("editor/restoreSession", true).toBool ()) - { - // Have all file editor tabs signal what their file names are. - emit fetab_file_name_query (0); - } + // save file names (even if last session will not be restored next time) QStringList fetFileNames; for (editor_tab_map_const_iterator p = editor_tab_map.begin (); p != editor_tab_map.end (); p++) - fetFileNames.append (p->first); + { + QString file_name = p->first; + if (!file_name.isEmpty () && file_name.at (file_name.size () - 1) != '/') + fetFileNames.append (p->first); // do not append unnamed files + } settings->setValue ("editor/savedSessionTabs", fetFileNames); settings->sync ();