Mercurial > octave-dspies
changeset 18388:226285bce729 stable
context menu open in the file browser really opens the file
* file-docks-widget (contextmenu_open): instead of initiating the default
action for the file (via item_double_clicked, e.g. load the file), really
open the file as desired
author | Torsten <ttl@justmail.de> |
---|---|
date | Sat, 25 Jan 2014 14:30:36 +0100 |
parents | f1312db94896 |
children | d2aa3948cec8 |
files | libgui/src/files-dock-widget.cc |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/files-dock-widget.cc Sat Jan 25 13:51:25 2014 +0100 +++ b/libgui/src/files-dock-widget.cc Sat Jan 25 14:30:36 2014 +0100 @@ -531,7 +531,14 @@ for ( QModelIndexList::iterator it = rows.begin (); it != rows.end (); it++) { - item_double_clicked (*it); + QFileInfo file = _file_system_model->fileInfo (*it); + if (file.exists ()) + { + if (file.isFile ()) + emit open_file (file.absoluteFilePath ()); + else + set_current_directory (file.absoluteFilePath ()); + } } }