Check for XSwiftBus version before download

This commit is contained in:
Klaus Basan
2019-03-27 17:56:43 +01:00
committed by Mat Sutcliffe
parent c900123af5
commit b13035b3f9
4 changed files with 44 additions and 6 deletions

View File

@@ -57,6 +57,16 @@ namespace BlackMisc
return this->findFirstByOrDefault(&CRemoteFile::getName, name);
}
CRemoteFile CRemoteFileList::findFirstContainingNameOrDefault(const QString &name, Qt::CaseSensitivity cs) const
{
if (name.isEmpty()) { return CRemoteFile(); }
for (const CRemoteFile &rf : *this)
{
if (rf.getName().contains(name, cs)) { return rf; }
}
return CRemoteFile();
}
CRemoteFile CRemoteFileList::findFirstByMatchingNameOrDefault(const QString &name) const
{
if (name.isEmpty()) { return CRemoteFile(); }

View File

@@ -52,6 +52,9 @@ namespace BlackMisc
//! First by name of default
CRemoteFile findFirstByNameOrDefault(const QString &name) const;
//! First by name contained of default
CRemoteFile findFirstContainingNameOrDefault(const QString &name, Qt::CaseSensitivity cs) const;
//! Find first matching name of default
CRemoteFile findFirstByMatchingNameOrDefault(const QString &name) const;