]> git.mxchange.org Git - flightgear.git/commitdiff
FlightGear path API tweaks
authorJames Turner <zakalawe@mac.com>
Fri, 15 Jul 2016 09:15:55 +0000 (10:15 +0100)
committerRoland Haeder <roland@mxchange.org>
Thu, 22 Sep 2016 21:27:47 +0000 (23:27 +0200)
src/GUI/MessageBox.cxx
src/GUI/SetupRootDialog.cxx

index ca2e890ab3ffab13b2e05674ebc9fcbe0adc9660..f4bdf69903bcea508816a80d1ee37fedd789ec3d 100644 (file)
@@ -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;
index 46c9f476c40b741d5b580b6851de9d939314c77b..e1cb65be86752fb7505cbac85ff80bea6b4c3c26 100644 (file)
@@ -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);
 }