mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Ref T660, utility functions
* check if model is in path * addAsValidOrInvalidModel * set corresponding simulator for validation * display validation of empty model set
This commit is contained in:
committed by
Mat Sutcliffe
parent
d59e1c3332
commit
f3ec7a8a68
@@ -766,6 +766,19 @@ namespace BlackMisc
|
||||
return this->getFileDirectory().absolutePath();
|
||||
}
|
||||
|
||||
bool CAircraftModel::isInPath(const QString &path, Qt::CaseSensitivity cs) const
|
||||
{
|
||||
const QString p(this->getFileDirectoryPath());
|
||||
if (path.isEmpty() || p.isEmpty()) { return false; }
|
||||
if (path.startsWith('/'))
|
||||
{
|
||||
if (path.endsWith('/')) { return p.contains(path.mid(1, path.length() - 2), cs); }
|
||||
return p.contains(path.mid(1));
|
||||
}
|
||||
if (path.endsWith('/')) { return p.contains(path.left(path.length() - 1), cs); }
|
||||
return (p.contains(path, cs));
|
||||
}
|
||||
|
||||
bool CAircraftModel::hasExistingIconFile() const
|
||||
{
|
||||
if (m_iconFile.isEmpty()) { return false; }
|
||||
|
||||
Reference in New Issue
Block a user