mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
Ref T515, utility functions for file name/path etc.
This commit is contained in:
committed by
Mat Sutcliffe
parent
a0c8f3778b
commit
107464d92a
@@ -729,6 +729,19 @@ namespace BlackMisc
|
||||
return (fi.exists() && fi.isReadable());
|
||||
}
|
||||
|
||||
QDir CAircraftModel::getFileDirectory() const
|
||||
{
|
||||
if (!this->hasFileName()) { return QDir(); }
|
||||
const QFileInfo fi(CFileUtils::fixWindowsUncPath(this->getFileName()));
|
||||
return fi.absoluteDir();
|
||||
}
|
||||
|
||||
QString CAircraftModel::getFileDirectoryPath() const
|
||||
{
|
||||
if (!this->hasFileName()) { return QStringLiteral(""); }
|
||||
return this->getFileDirectory().absolutePath();
|
||||
}
|
||||
|
||||
bool CAircraftModel::matchesModelString(const QString &modelString, Qt::CaseSensitivity sensitivity) const
|
||||
{
|
||||
if (sensitivity == Qt::CaseInsensitive) { return caseInsensitiveStringCompare(modelString, m_modelString); }
|
||||
|
||||
Reference in New Issue
Block a user