Mercurial > hg > octave-nkf
diff libgui/src/files-dock-widget.cc @ 18456: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 |
line wrap: on
line diff
--- a/libgui/src/files-dock-widget.cc +++ b/libgui/src/files-dock-widget.cc @@ -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 ()); + } } }