mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 16:55:36 +08:00
#42 CRemoteFile name can include directory path components
This commit is contained in:
@@ -36,9 +36,9 @@ namespace BlackMisc
|
||||
bool CRemoteFile::matchesName(const QString &name) const
|
||||
{
|
||||
if (name.isEmpty()) { return false; }
|
||||
if (caseInsensitiveStringCompare(name, this->getName())) { return true; }
|
||||
if (name.startsWith(this->getName(), Qt::CaseInsensitive)) { return true; }
|
||||
if (this->getName().startsWith(name, Qt::CaseInsensitive)) { return true; }
|
||||
if (caseInsensitiveStringCompare(name, this->getBaseName())) { return true; }
|
||||
if (name.startsWith(this->getBaseName(), Qt::CaseInsensitive)) { return true; }
|
||||
if (this->getBaseName().startsWith(name, Qt::CaseInsensitive)) { return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,9 @@ namespace BlackMisc
|
||||
//! Name
|
||||
const QString &getName() const { return m_name; }
|
||||
|
||||
//! Name with directory stripped
|
||||
QString getBaseName() const { return m_name.section('/', -1); }
|
||||
|
||||
//! Has name?
|
||||
bool hasName() const { return !m_name.isEmpty(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user