mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
Ref T288, XPlane model in login component
This commit is contained in:
@@ -42,13 +42,14 @@ namespace XSwiftBus
|
|||||||
g_xplanePath = xplanePath;
|
g_xplanePath = xplanePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getDirName(const string &filePath)
|
std::string getDirName(const std::string &filePath)
|
||||||
{
|
{
|
||||||
std::string seperator = "/\\";
|
std::string seperator = "/\\";
|
||||||
std::size_t sepPos = filePath.find_last_of(seperator);
|
std::size_t sepPos = filePath.find_last_of(seperator);
|
||||||
if(sepPos != std::string::npos)
|
if (sepPos != std::string::npos)
|
||||||
{
|
{
|
||||||
return filePath.substr(0, sepPos);
|
std::string dirPath = filePath.substr(0, sepPos);
|
||||||
|
return getFileName(dirPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -60,7 +61,7 @@ namespace XSwiftBus
|
|||||||
{
|
{
|
||||||
std::string seperator = "/\\";
|
std::string seperator = "/\\";
|
||||||
std::size_t sepPos = filePath.find_last_of(seperator);
|
std::size_t sepPos = filePath.find_last_of(seperator);
|
||||||
if(sepPos != std::string::npos)
|
if (sepPos != std::string::npos)
|
||||||
{
|
{
|
||||||
return filePath.substr(sepPos + 1, filePath.size() - 1);
|
return filePath.substr(sepPos + 1, filePath.size() - 1);
|
||||||
}
|
}
|
||||||
@@ -75,9 +76,9 @@ namespace XSwiftBus
|
|||||||
std::string seperator = ".";
|
std::string seperator = ".";
|
||||||
std::string fileName = getFileName(filePath);
|
std::string fileName = getFileName(filePath);
|
||||||
std::size_t sepPos = fileName.find(seperator);
|
std::size_t sepPos = fileName.find(seperator);
|
||||||
if(sepPos != std::string::npos)
|
if (sepPos != std::string::npos)
|
||||||
{
|
{
|
||||||
return fileName.substr(0, sepPos);
|
return fileName.substr(0, sepPos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -113,7 +114,7 @@ namespace XSwiftBus
|
|||||||
ss << "xswiftbus";
|
ss << "xswiftbus";
|
||||||
ss << ' ';
|
ss << ' ';
|
||||||
|
|
||||||
#if defined(XSWIFTBUS_ENABLE_TRACE_LOG)
|
#if defined(XSWIFTBUS_ENABLE_TRACE_LOG)
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case DebugMsg:
|
case DebugMsg:
|
||||||
@@ -133,9 +134,9 @@ namespace XSwiftBus
|
|||||||
|
|
||||||
std::string seperator = "/\\";
|
std::string seperator = "/\\";
|
||||||
std::size_t sepPos = filePath.find_last_of(seperator);
|
std::size_t sepPos = filePath.find_last_of(seperator);
|
||||||
if(sepPos != std::string::npos)
|
if (sepPos != std::string::npos)
|
||||||
{
|
{
|
||||||
ss << filePath.substr(sepPos + 1, filePath.size() - 1);
|
ss << filePath.substr(sepPos + 1, filePath.size() - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -145,7 +146,7 @@ namespace XSwiftBus
|
|||||||
|
|
||||||
ss << line;
|
ss << line;
|
||||||
ss << " : ";
|
ss << " : ";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ss << message;
|
ss << message;
|
||||||
ss << "\n";
|
ss << "\n";
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKSIM_XSWIFTBUS_UTILS_H
|
#ifndef BLACKSIM_XSWIFTBUS_UTILS_H
|
||||||
#define BLACKSIM_XSWIFTBUS_UTILS_H
|
#define BLACKSIM_XSWIFTBUS_UTILS_H
|
||||||
|
|
||||||
@@ -21,10 +23,6 @@
|
|||||||
#include <clocale>
|
#include <clocale>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
/*!
|
|
||||||
* \file
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Install a Qt message handler which outputs to the X-Plane debug log.
|
* Install a Qt message handler which outputs to the X-Plane debug log.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user