mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +08:00
Utility functions, status messages and model list
Ref T247 follow up
This commit is contained in:
committed by
Mat Sutcliffe
parent
5c870a8404
commit
fd1f6bcc84
@@ -742,7 +742,9 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (!this->hasFileName()) { return false; }
|
if (!this->hasFileName()) { return false; }
|
||||||
const QFileInfo fi(CFileUtils::fixWindowsUncPath(this->getFileName()));
|
const QFileInfo fi(CFileUtils::fixWindowsUncPath(this->getFileName()));
|
||||||
return (fi.exists() && fi.isReadable());
|
if (!fi.exists()) { return false; }
|
||||||
|
const bool r = fi.isReadable();
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDir CAircraftModel::getFileDirectory() const
|
QDir CAircraftModel::getFileDirectory() const
|
||||||
|
|||||||
@@ -1325,7 +1325,11 @@ namespace BlackMisc
|
|||||||
if (!alreadySortedByFn) { sorted.sortByFileName(); }
|
if (!alreadySortedByFn) { sorted.sortByFileName(); }
|
||||||
|
|
||||||
const bool caseSensitive = CFileUtils::isFileNameCaseSensitive();
|
const bool caseSensitive = CFileUtils::isFileNameCaseSensitive();
|
||||||
const QString rDir = caseSensitive ? rootDirectory : rootDirectory.toLower();
|
const QString rDir = CFileUtils::normalizeFilePathToQtStandard(
|
||||||
|
CFileUtils::stripLeadingSlashOrDriveLetter(
|
||||||
|
caseSensitive ? rootDirectory : rootDirectory.toLower()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
for (const CAircraftModel &model : as_const(sorted))
|
for (const CAircraftModel &model : as_const(sorted))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -133,6 +133,12 @@ namespace BlackMisc
|
|||||||
this->sortBy(&CStatusMessage::getSeverity);
|
this->sortBy(&CStatusMessage::getSeverity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CStatusMessageList::sortBySeverityHighestFirst()
|
||||||
|
{
|
||||||
|
this->sortBy(&CStatusMessage::getSeverity);
|
||||||
|
this->reverse();
|
||||||
|
}
|
||||||
|
|
||||||
void CStatusMessageList::removeWarningsAndBelow()
|
void CStatusMessageList::removeWarningsAndBelow()
|
||||||
{
|
{
|
||||||
if (this->isEmpty()) { return; }
|
if (this->isEmpty()) { return; }
|
||||||
|
|||||||
@@ -95,6 +95,9 @@ namespace BlackMisc
|
|||||||
//! Sort by severity, lowest first
|
//! Sort by severity, lowest first
|
||||||
void sortBySeverity();
|
void sortBySeverity();
|
||||||
|
|
||||||
|
//! Sort by severity, highest first
|
||||||
|
void sortBySeverityHighestFirst();
|
||||||
|
|
||||||
//! Remove warnings and below
|
//! Remove warnings and below
|
||||||
void removeWarningsAndBelow();
|
void removeWarningsAndBelow();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user