Mercurial > hg > octave-nkf
diff libgui/src/m-editor/file-editor.cc @ 15861:f425e680925e
editor: when opening an open file, bring its tab (even with short title) on top
* file-editor.cc(request_open_file): also check for a tab title containing the
file name without complete path when bringing tab of already open file on top
author | Torsten <ttl@justmail.de> |
---|---|
date | Fri, 28 Dec 2012 15:39:46 +0100 |
parents | feba9ff6e6a8 |
children | 7d300b85ee25 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -147,9 +147,12 @@ msgBox->setWindowModality (Qt::NonModal); msgBox->setAttribute (Qt::WA_DeleteOnClose); msgBox->show (); + QFileInfo file(openFileName); + QString short_openFileName = file.fileName(); // get file name only for(int i = 0; i < _tab_widget->count (); i++) - { - if (_tab_widget->tabText (i) == openFileName) + { // check whether tab title is file name (long or short) + if (_tab_widget->tabText (i) == openFileName || + _tab_widget->tabText (i) == short_openFileName) { _tab_widget->setCurrentIndex (i); break;