changeset 15900:80e99730e5d4

gui: set locale to C before starting the interpreter * octave-main-thread.cc(run): set locale to C instead of en_US.UTF-8. * octave-qt-event-listener.cc(current_directory_has_changed): use the correct charset for emitting the signal with a new directory. * main-window.cc(change_current_working_directory,set_current_working_directory) use the correct charset when sending a new directory from the gui to octave. * history-dockwidget.cc(update_history_callback): use the correct chareset for displaying the history. * symbol-information.h: correct charset for displaying value in workspace view.
author Torsten <ttl@justmail.de>
date Sat, 05 Jan 2013 08:35:09 +0100
parents f59797321a1b
children 927b121ad63f
files libgui/src/history-dockwidget.cc libgui/src/main-window.cc libgui/src/octave-adapter/octave-main-thread.cc libgui/src/octave-qt-event-listener.cc libgui/src/symbol-information.h
diffstat 5 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/history-dockwidget.cc	Fri Jan 04 14:14:41 2013 -0800
+++ b/libgui/src/history-dockwidget.cc	Sat Jan 05 08:35:09 2013 +0100
@@ -200,7 +200,7 @@
           std::string entry = command_history::get_entry (i);
 
           _history_model->setData (_history_model->index (i),
-                      QString::fromLocal8Bit (entry.data (), entry.size ()));
+                      QString::fromUtf8 (entry.data (), entry.size ()));
         }
 
       // FIXME -- does this behavior make sense?  Calling
--- a/libgui/src/main-window.cc	Fri Jan 04 14:14:41 2013 -0800
+++ b/libgui/src/main-window.cc	Sat Jan 05 08:35:09 2013 +0100
@@ -286,7 +286,7 @@
 
   if (!directory.isEmpty ())
     {
-      std::string dir = directory.toLocal8Bit ().data ();
+      std::string dir = directory.toUtf8 ().data ();
       octave_link::post_event (this, &main_window::change_directory_callback,dir);
     }
 }
@@ -297,7 +297,7 @@
   QFileInfo fileInfo (directory);  // check whether this is an existing dir
   if (fileInfo.exists () && fileInfo.isDir ())   // is dir and exists
     {
-      std::string dir = directory.toLocal8Bit ().data ();
+      std::string dir = directory.toUtf8 ().data ();
       octave_link::post_event (this, &main_window::change_directory_callback,dir);
     }
 }
--- a/libgui/src/octave-adapter/octave-main-thread.cc	Fri Jan 04 14:14:41 2013 -0800
+++ b/libgui/src/octave-adapter/octave-main-thread.cc	Sat Jan 05 08:35:09 2013 +0100
@@ -38,7 +38,7 @@
 void
 octave_main_thread::run ()
 {
-  setlocale (LC_ALL, "en_US.UTF-8");
+  setlocale (LC_ALL, "C");
 
   emit ready ();
 
--- a/libgui/src/octave-qt-event-listener.cc	Fri Jan 04 14:14:41 2013 -0800
+++ b/libgui/src/octave-qt-event-listener.cc	Sat Jan 05 08:35:09 2013 +0100
@@ -36,7 +36,7 @@
 octave_qt_event_listener::current_directory_has_changed (const std::string& directory)
 {
   emit current_directory_has_changed_signal
-    (QString::fromLocal8Bit (directory.data (), directory.size ()));
+    (QString::fromUtf8 (directory.data (), directory.size ()));
 }
 
 void
--- a/libgui/src/symbol-information.h	Fri Jan 04 14:14:41 2013 -0800
+++ b/libgui/src/symbol-information.h	Sat Jan 05 08:35:09 2013 +0100
@@ -81,7 +81,11 @@
 
   QString symbol (void) const { return _symbol; }
   QString class_name (void) const { return _class_name; }
-  QString value (void) const { return _value; }
+  QString value (void) const
+    {
+      return QString::fromUtf8 (_value.toStdString ().data (),
+                                _value.toStdString ().size ());
+    }
   QString dimension (void) const { return _dimension; }
   Scope scope (void) const { return _scope; }