mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 02:06:08 +08:00
Change CService::getAircraftLivery() to return livery without path
CService::getAircraftLivery() is expected to return the livery name itself without the full path. ref T378
This commit is contained in:
committed by
Klaus Basan
parent
1fecf65a40
commit
1a63c00a71
@@ -104,6 +104,16 @@ namespace XSwiftBus
|
|||||||
return acfProperties.modelName;
|
return acfProperties.modelName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CService::getAircraftLivery() const
|
||||||
|
{
|
||||||
|
std::string liveryPath = m_liveryPath.get();
|
||||||
|
if (liveryPath.empty()) { return {}; }
|
||||||
|
|
||||||
|
// liveryPath end with / and we need to get rid of it
|
||||||
|
liveryPath.pop_back();
|
||||||
|
return getFileName(liveryPath);
|
||||||
|
}
|
||||||
|
|
||||||
int CService::getXPlaneVersionMajor() const
|
int CService::getXPlaneVersionMajor() const
|
||||||
{
|
{
|
||||||
int version;
|
int version;
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ namespace XSwiftBus
|
|||||||
//! Get name of current aircraft model
|
//! Get name of current aircraft model
|
||||||
std::string getAircraftName() const;
|
std::string getAircraftName() const;
|
||||||
|
|
||||||
//! Get path to current aircraft livery
|
//! Get current aircraft livery
|
||||||
std::string getAircraftLivery() const { return m_liveryPath.get(); }
|
std::string getAircraftLivery() const;
|
||||||
|
|
||||||
//! Get the ICAO code of the current aircraft model
|
//! Get the ICAO code of the current aircraft model
|
||||||
std::string getAircraftIcaoCode() const { return m_icao.get(); }
|
std::string getAircraftIcaoCode() const { return m_icao.get(); }
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ namespace BlackMiscTest
|
|||||||
QCOMPARE(QString::fromStdString(getFileName("foo/test.txt")), QString("test.txt"));
|
QCOMPARE(QString::fromStdString(getFileName("foo/test.txt")), QString("test.txt"));
|
||||||
QCOMPARE(QString::fromStdString(getFileName("test.txt")), QString("test.txt"));
|
QCOMPARE(QString::fromStdString(getFileName("test.txt")), QString("test.txt"));
|
||||||
QCOMPARE(QString::fromStdString(getFileName("foo/test.txt.txt")), QString("test.txt.txt"));
|
QCOMPARE(QString::fromStdString(getFileName("foo/test.txt.txt")), QString("test.txt.txt"));
|
||||||
|
QCOMPARE(QString::fromStdString(getFileName("foo/bar")), QString("bar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTestXPlane::getDirNameTest()
|
void CTestXPlane::getDirNameTest()
|
||||||
|
|||||||
Reference in New Issue
Block a user