# HG changeset patch # User Torsten # Date 1356705586 -3600 # Node ID f425e680925e091433f674cd8f69ea94de291878 # Parent feba9ff6e6a83548942799bba8ae9fe73b21feaf 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 diff -r feba9ff6e6a8 -r f425e680925e libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Fri Dec 28 15:01:08 2012 +0100 +++ b/libgui/src/m-editor/file-editor.cc Fri Dec 28 15:39:46 2012 +0100 @@ -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;