Mercurial > hg > octave-lojdl
changeset 15758:d90b426b9988
respect charset when syncing directories between octave and gui (bug #37813)
* octave-qt-event-listener.cc: signal current_directory_has_changed_signal
emitted with directory as QString from local8Bit
* main-window.cc: change_current_working_directory () and
set_current_working_directory () : post event with directory as
std::string to local8Bit;
author | Torsten <ttl@justmail.de> |
---|---|
date | Sun, 25 Nov 2012 21:52:06 +0100 |
parents | 534a2c881f45 |
children | b0ad083e1958 |
files | libgui/src/main-window.cc libgui/src/octave-qt-event-listener.cc |
diffstat | 2 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -246,12 +246,14 @@ void main_window::change_current_working_directory () { - QString selectedDirectory = + QString directory = QFileDialog::getExistingDirectory(this, tr ("Set working direcotry")); - if (!selectedDirectory.isEmpty ()) - octave_link::post_event (this, &main_window::change_directory_callback, - selectedDirectory.toStdString ()); + if (!directory.isEmpty ()) + { + std::string dir = directory.toLocal8Bit ().data (); + octave_link::post_event (this, &main_window::change_directory_callback,dir); + } } void @@ -259,8 +261,10 @@ { QFileInfo fileInfo (directory); // check whether this is an existing dir if (fileInfo.exists () && fileInfo.isDir ()) // is dir and exists - octave_link::post_event (this, &main_window::change_directory_callback, - directory.toStdString ()); + { + std::string dir = directory.toLocal8Bit ().data (); + octave_link::post_event (this, &main_window::change_directory_callback,dir); + } } void
--- a/libgui/src/octave-qt-event-listener.cc +++ b/libgui/src/octave-qt-event-listener.cc @@ -36,7 +36,7 @@ octave_qt_event_listener::current_directory_has_changed (const std::string& directory) { emit current_directory_has_changed_signal - (QString::fromStdString (directory)); + (QString::fromLocal8Bit (directory.data (), directory.size ())); } void