mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #452, adjusted aircraft/aviation classes
* support for loading from datastore * improved timestamp handling * new color and country classes * new attributes * updates for missing parts in CUser
This commit is contained in:
committed by
Mathew Sutcliffe
parent
c5f7179588
commit
ae24700299
@@ -14,7 +14,7 @@
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/variant.h"
|
||||
#include <tuple>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
@@ -116,45 +116,20 @@ namespace BlackMisc
|
||||
return msgs;
|
||||
}
|
||||
|
||||
void CUser::updateMissingParts(const CUser &otherUser)
|
||||
{
|
||||
if (this == &otherUser) { return; }
|
||||
if (!this->hasValidRealName()) { this->setRealName(otherUser.getRealName()); }
|
||||
if (!this->hasValidId()) { this->setId(otherUser.getId()); }
|
||||
if (!this->hasValidEmail()) { this->setEmail(otherUser.getEmail()); }
|
||||
if (!this->hasValidCallsign()) { this->setCallsign(otherUser.getCallsign()); }
|
||||
}
|
||||
|
||||
void CUser::syncronizeData(CUser &otherUser)
|
||||
{
|
||||
if (otherUser == (*this)) { return; }
|
||||
|
||||
if (this->hasValidRealName())
|
||||
{
|
||||
otherUser.setRealName(this->getRealName());
|
||||
}
|
||||
else if (otherUser.hasValidRealName())
|
||||
{
|
||||
this->setRealName(otherUser.getRealName());
|
||||
}
|
||||
|
||||
if (this->hasValidId())
|
||||
{
|
||||
otherUser.setId(this->getId());
|
||||
}
|
||||
else if (otherUser.hasValidId())
|
||||
{
|
||||
this->setId(otherUser.getId());
|
||||
}
|
||||
|
||||
if (this->hasValidEmail())
|
||||
{
|
||||
otherUser.setEmail(this->getEmail());
|
||||
}
|
||||
else if (otherUser.hasValidEmail())
|
||||
{
|
||||
this->setEmail(otherUser.getEmail());
|
||||
}
|
||||
|
||||
if (this->hasValidCallsign())
|
||||
{
|
||||
otherUser.setCallsign(this->getCallsign());
|
||||
}
|
||||
else if (otherUser.hasValidCallsign())
|
||||
{
|
||||
this->setCallsign(otherUser.getCallsign());
|
||||
}
|
||||
if (this == &otherUser) { return; }
|
||||
this->updateMissingParts(otherUser);
|
||||
otherUser.updateMissingParts(*this);
|
||||
}
|
||||
|
||||
bool CUser::isValidVatsimId(const QString &id)
|
||||
|
||||
Reference in New Issue
Block a user