From ecb8ec57c086d79d84fdad04245cf9bcb5ca1a3f Mon Sep 17 00:00:00 2001
From: James Turner <zakalawe@mac.com>
Date: Fri, 15 Jul 2016 10:15:55 +0100
Subject: [PATCH] FlightGear path API tweaks

---
 src/GUI/MessageBox.cxx      | 6 ++----
 src/GUI/SetupRootDialog.cxx | 4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/GUI/MessageBox.cxx b/src/GUI/MessageBox.cxx
index ca2e890ab..f4bdf6990 100644
--- a/src/GUI/MessageBox.cxx
+++ b/src/GUI/MessageBox.cxx
@@ -87,12 +87,10 @@ win32MessageBox(const std::string& caption,
     }
     
     UINT mbType = MB_OK;
-	WCharVec wMsg(convertUtf8ToWString(fullMsg)),
+	std::wstring wMsg(convertUtf8ToWString(fullMsg)),
 		wCap(convertUtf8ToWString(caption));
-	wMsg.push_back(0);
-	wCap.push_back(0);
 
-	::MessageBoxExW(ownerWindow, wMsg.data(), wCap.data(),
+	::MessageBoxExW(ownerWindow, wMsg.c_str(), wCap.c_str(),
                     mbType, 0 /* system lang */);
 
 	return flightgear::MSG_BOX_OK;
diff --git a/src/GUI/SetupRootDialog.cxx b/src/GUI/SetupRootDialog.cxx
index 46c9f476c..e1cb65be8 100644
--- a/src/GUI/SetupRootDialog.cxx
+++ b/src/GUI/SetupRootDialog.cxx
@@ -107,7 +107,7 @@ SGPath SetupRootDialog::restoreUserSelectedRoot()
     }
 
     if (validatePath(path) && validateVersion(path)) {
-        return path.toStdString();
+        return SGPath::fromUtf8(path.toStdString());
     } else {
         // we have an existing path but it's invalid. Let's ask the
         // user what they want
@@ -147,7 +147,7 @@ bool SetupRootDialog::validatePath(QString path)
 
 bool SetupRootDialog::validateVersion(QString path)
 {
-    std::string ver = fgBasePackageVersion(SGPath(path.toStdString()));
+    std::string ver = fgBasePackageVersion(SGPath::fromUtf8(path.toStdString()));
     return (ver == FLIGHTGEAR_VERSION);
 }