mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
refs #787, utility functions for shared files
* get file name from URL * service and file names in CDbInfo * adjusted DB flags, allow to load headers only * set of entity flags
This commit is contained in:
@@ -155,6 +155,18 @@ namespace BlackMisc
|
||||
return NoEntity;
|
||||
}
|
||||
|
||||
QSet<CEntityFlags::Entity> CEntityFlags::asSingleEntities(Entity entities)
|
||||
{
|
||||
QSet<CEntityFlags::Entity> s;
|
||||
CEntityFlags::Entity currentEntity = iterateDbEntities(entities);
|
||||
while (currentEntity != NoEntity)
|
||||
{
|
||||
s.insert(currentEntity);
|
||||
currentEntity = iterateDbEntities(entities);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
void CEntityFlags::registerMetadata()
|
||||
{
|
||||
// this is no value class and I register enums here,
|
||||
|
||||
@@ -96,7 +96,10 @@ namespace BlackMisc
|
||||
static bool anySwiftDbEntity(Entity entities);
|
||||
|
||||
//! Get by name
|
||||
static CEntityFlags::Entity singleEntityByName(const QString &name);
|
||||
static Entity singleEntityByName(const QString &name);
|
||||
|
||||
//! As set of single entities
|
||||
static QSet<Entity> asSingleEntities(Entity entities);
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
@@ -124,6 +124,11 @@ namespace BlackMisc
|
||||
setQUrl(QUrl(fullUrl));
|
||||
}
|
||||
|
||||
QString CUrl::getFileName() const
|
||||
{
|
||||
return toQUrl().fileName();
|
||||
}
|
||||
|
||||
QUrl CUrl::toQUrl() const
|
||||
{
|
||||
return QUrl(getFullUrl());
|
||||
|
||||
@@ -115,6 +115,9 @@ namespace BlackMisc
|
||||
//! Set full URL
|
||||
void setFullUrl(const QString &fullUrl);
|
||||
|
||||
//! File name
|
||||
QString getFileName() const;
|
||||
|
||||
//! To QUrl
|
||||
QUrl toQUrl() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user