Commit 7f40526d authored by Adam Paquette's avatar Adam Paquette
Browse files

Reset locale after creating either a QApplication or a QCoreApplication. Fixes #3908.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7047 41f8697f-d340-4b68-9986-7bafba869bb8
parent f57b8189
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ namespace Isis {
      QString xmlfile = f.expanded();

      p_ui = new UserInterface(xmlfile, argc, argv);

      if (!p_ui->IsInteractive()) {
        // Get the starting wall clock time
        p_datetime = DateTime(&p_startTime);
@@ -138,9 +139,15 @@ namespace Isis {
        
        if (p_applicationForceGuiApp) {
          new QApplication(argc, argv, QApplication::Tty);
          // When QApplication is initialized, it will reset the locale to the shells locale. As a result
          // the locale needs to be reset after QApplications initialization.
          setlocale(LC_ALL, "en_US");
        }
        else {
          new QCoreApplication(argc, argv);
          // When QCoreApplication is initialized, it will reset the locale to the shells locale. As a result
          // the locale needs to be reset after QCoreApplications initialization.
          setlocale(LC_ALL, "en_US");
        }

        QCoreApplication::setApplicationName(FileName(p_appName).baseName());
+2 −0
Original line number Diff line number Diff line
@@ -108,6 +108,8 @@ namespace Isis {
   *                          Also needed to define a compiler directive,
   *                          USE_GUI_QAPP, to bypass a problem the Macs have
   *                          with using QApplication. References #575.
   *   @history 2016-08-15 Adam Paquette - Reset locale after QApplication or 
   *                          QCoreApplication are instantiated. Fixes #3908.
   */
  class Application : public Environment {
    public:
+3 −0
Original line number Diff line number Diff line
@@ -77,6 +77,9 @@ namespace Isis {

    // Create the application
    new QApplication(argc, argv);
    // When QApplication is initialized, it will reset the locale to the shells locale. As a result
    // the locale needs to be reset after QApplications initialization.
    std::setlocale(LC_ALL, "en_US");
    QCoreApplication::setApplicationName(FileName(argv[0]).baseName());
    QApplication::setQuitOnLastWindowClosed(true);

+3 −1
Original line number Diff line number Diff line
@@ -78,7 +78,9 @@ namespace Isis {
   *                         also update exclusions for boolean widgets. References
   *                         #1452.
   *  @history 2016-06-28 Adam Paquette - Modified UpdateHistory to appropriately
   *                         retrieve lists from the history pvl
   *                         retrieve lists from the history pvl.
   *  @history 2016-08-15 Adam Paquette - Reset locale after QApplication is 
   *                         instantiated. Fixes #3908.
   */

  class Gui : public QMainWindow {