mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Ref T265, Ref T430, Ref T473 functions renamed
This commit is contained in:
committed by
Mat Sutcliffe
parent
6bd3a50ed8
commit
2d3e2e2d99
@@ -175,7 +175,7 @@ namespace BlackMisc
|
||||
const bool existing = json.value("existing").toBool();
|
||||
|
||||
CArtifact artifact(name, version, md5, type, size, existing, platform);
|
||||
artifact.setKeyAndTimestampFromDatabaseJson(json);
|
||||
artifact.setKeyVersionTimestampFromDatabaseJson(json);
|
||||
if (json.contains("distributions"))
|
||||
{
|
||||
const QJsonObject distJson = json.value("distributions").toObject();
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
void IDatastoreObject::setTimestampAndVersionFromDatabaseJson(const QJsonObject &json, const QString &prefix)
|
||||
void IDatastoreObject::setTimestampVersionFromDatabaseJson(const QJsonObject &json, const QString &prefix)
|
||||
{
|
||||
// we check 2 formats, the DB format and the backend object format
|
||||
QString timestampString(json.value(prefix % u"lastupdated").toString());
|
||||
@@ -84,12 +84,12 @@ namespace BlackMisc
|
||||
return QJsonValue();
|
||||
}
|
||||
|
||||
void IDatastoreObjectWithIntegerKey::setKeyAndTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix)
|
||||
void IDatastoreObjectWithIntegerKey::setKeyVersionTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix)
|
||||
{
|
||||
// this function is performance sensitive, as it is called for all DB data
|
||||
const int dbKey = json.value(prefix % u"id").toInt(-1);
|
||||
this->setDbKey(dbKey);
|
||||
IDatastoreObject::setTimestampAndVersionFromDatabaseJson(json, prefix);
|
||||
IDatastoreObject::setTimestampVersionFromDatabaseJson(json, prefix);
|
||||
}
|
||||
|
||||
bool IDatastoreObjectWithIntegerKey::existsKey(const QJsonObject &json, const QString &prefix)
|
||||
@@ -176,11 +176,11 @@ namespace BlackMisc
|
||||
return empty;
|
||||
}
|
||||
|
||||
void IDatastoreObjectWithStringKey::setKeyAndTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix)
|
||||
void IDatastoreObjectWithStringKey::setKeyVersionTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix)
|
||||
{
|
||||
QString dbKey = json.value(prefix % u"id").toString();
|
||||
this->setDbKey(dbKey);
|
||||
IDatastoreObject::setTimestampAndVersionFromDatabaseJson(json, prefix);
|
||||
IDatastoreObject::setTimestampVersionFromDatabaseJson(json, prefix);
|
||||
}
|
||||
|
||||
bool IDatastoreObjectWithStringKey::existsKey(const QJsonObject &json, const QString &prefix)
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
//! Set versionn and timestamp values
|
||||
void setTimestampAndVersionFromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
|
||||
void setTimestampVersionFromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
|
||||
|
||||
QString m_version; //!< version info
|
||||
};
|
||||
@@ -128,7 +128,7 @@ namespace BlackMisc
|
||||
IDatastoreObjectWithIntegerKey(int key) : m_dbKey(key) {}
|
||||
|
||||
//! Set key and timestamp values
|
||||
void setKeyAndTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
|
||||
void setKeyVersionTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
|
||||
|
||||
//! Is a key available?
|
||||
static bool existsKey(const QJsonObject &json, const QString &prefix = QString());
|
||||
@@ -209,7 +209,7 @@ namespace BlackMisc
|
||||
IDatastoreObjectWithStringKey(const QString &key) : m_dbKey(key) {}
|
||||
|
||||
//! Set key and timestamp values
|
||||
void setKeyAndTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
|
||||
void setKeyVersionTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
|
||||
|
||||
//! Is a key available?
|
||||
static bool existsKey(const QJsonObject &json, const QString &prefix = QString());
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace BlackMisc
|
||||
const int entries(json.value(prefix + "entries").toInt());
|
||||
const QString tableName(json.value(prefix + "tablename").toString());
|
||||
CDbInfo dbInfo(id, tableName, entries);
|
||||
dbInfo.setKeyAndTimestampFromDatabaseJson(json, prefix);
|
||||
dbInfo.setKeyVersionTimestampFromDatabaseJson(json, prefix);
|
||||
return dbInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace BlackMisc
|
||||
const bool restricted = json.value("restricted").toBool();
|
||||
const int stability = json.value("stability").toInt();
|
||||
CDistribution distribution(channel, stability, restricted);
|
||||
distribution.setKeyAndTimestampFromDatabaseJson(json);
|
||||
distribution.setKeyVersionTimestampFromDatabaseJson(json);
|
||||
|
||||
// add the URLs
|
||||
for (int i = 0; i < 5; i++)
|
||||
|
||||
Reference in New Issue
Block a user