mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T160, further formatting
This commit is contained in:
@@ -310,40 +310,24 @@ namespace BlackCore
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexDbRootDirectory:
|
||||
return CVariant::fromValue(this->m_dbRootDirectoryUrl);
|
||||
case IndexDbHttpPort:
|
||||
return CVariant::fromValue(this->m_dbHttpPort);
|
||||
case IndexDbHttpsPort:
|
||||
return CVariant::fromValue(this->m_dbHttpsPort);
|
||||
case IndexDbLoginService:
|
||||
return CVariant::fromValue(this->getDbLoginServiceUrl());
|
||||
case IndexVatsimStatus:
|
||||
return CVariant::fromValue(this->m_vatsimStatusFileUrls);
|
||||
case IndexVatsimData:
|
||||
return CVariant::fromValue(this->m_vatsimDataFileUrls);
|
||||
case IndexVatsimBookings:
|
||||
return CVariant::fromValue(this->m_vatsimDataFileUrls);
|
||||
case IndexVatsimMetars:
|
||||
return CVariant::fromValue(this->m_vatsimMetarsUrls);
|
||||
case IndexBootstrapFileUrls:
|
||||
return CVariant::fromValue(this->getSwiftBootstrapFileUrls());
|
||||
case IndexDistributionFileUrls:
|
||||
return CVariant::fromValue(this->getSwiftDistributionFileUrls());
|
||||
case IndexSharedUrls:
|
||||
return CVariant::fromValue(this->m_sharedUrls);
|
||||
case IndexNewsUrls:
|
||||
return CVariant::fromValue(this->m_newsUrls);
|
||||
case IndexSwiftMapUrls:
|
||||
return CVariant::fromValue(this->m_mapUrls);
|
||||
case IndexOnlineHelpUrls:
|
||||
return CVariant::fromValue(this->m_onlineHelpUrls);
|
||||
case IndexCrashReportServerUrl:
|
||||
return CVariant::fromValue(this->m_crashReportServerUrl);
|
||||
case IndexWasLoaded:
|
||||
return CVariant::fromValue(this->m_wasLoaded);
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
case IndexDbRootDirectory: return CVariant::fromValue(this->m_dbRootDirectoryUrl);
|
||||
case IndexDbHttpPort: return CVariant::fromValue(this->m_dbHttpPort);
|
||||
case IndexDbHttpsPort: return CVariant::fromValue(this->m_dbHttpsPort);
|
||||
case IndexDbLoginService: return CVariant::fromValue(this->getDbLoginServiceUrl());
|
||||
case IndexDbClientPingService: return CVariant::fromValue(this->getDbClientPingServiceUrl());
|
||||
case IndexVatsimStatus: return CVariant::fromValue(this->m_vatsimStatusFileUrls);
|
||||
case IndexVatsimData: return CVariant::fromValue(this->m_vatsimDataFileUrls);
|
||||
case IndexVatsimBookings: return CVariant::fromValue(this->m_vatsimDataFileUrls);
|
||||
case IndexVatsimMetars: return CVariant::fromValue(this->m_vatsimMetarsUrls);
|
||||
case IndexBootstrapFileUrls: return CVariant::fromValue(this->getSwiftBootstrapFileUrls());
|
||||
case IndexDistributionFileUrls: return CVariant::fromValue(this->getSwiftDistributionFileUrls());
|
||||
case IndexSharedUrls: return CVariant::fromValue(this->m_sharedUrls);
|
||||
case IndexNewsUrls: return CVariant::fromValue(this->m_newsUrls);
|
||||
case IndexSwiftMapUrls: return CVariant::fromValue(this->m_mapUrls);
|
||||
case IndexOnlineHelpUrls: return CVariant::fromValue(this->m_onlineHelpUrls);
|
||||
case IndexCrashReportServerUrl: return CVariant::fromValue(this->m_crashReportServerUrl);
|
||||
case IndexWasLoaded: return CVariant::fromValue(this->m_wasLoaded);
|
||||
default: return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,47 +343,21 @@ namespace BlackCore
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexDbRootDirectory:
|
||||
this->m_dbRootDirectoryUrl.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexDbHttpPort:
|
||||
this->m_dbHttpPort = variant.toInt();
|
||||
break;
|
||||
case IndexDbHttpsPort:
|
||||
this->m_dbHttpsPort = variant.toInt();
|
||||
break;
|
||||
case IndexDbLoginService:
|
||||
break;
|
||||
case IndexVatsimData:
|
||||
this->m_vatsimDataFileUrls = variant.value<CUrlList>();
|
||||
break;
|
||||
case IndexVatsimBookings:
|
||||
this->m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||
break;
|
||||
case IndexVatsimMetars:
|
||||
this->m_vatsimMetarsUrls = variant.value<CUrlList>();
|
||||
break;
|
||||
case IndexSharedUrls:
|
||||
this->m_sharedUrls = variant.value<CUrlList>();
|
||||
break;
|
||||
case IndexNewsUrls:
|
||||
this->m_newsUrls = variant.value<CUrlList>();
|
||||
break;
|
||||
case IndexOnlineHelpUrls:
|
||||
this->m_onlineHelpUrls = variant.value<CUrlList>();
|
||||
break;
|
||||
case IndexSwiftMapUrls:
|
||||
this->m_mapUrls = variant.value<CUrlList>();
|
||||
break;
|
||||
case IndexCrashReportServerUrl:
|
||||
this->m_crashReportServerUrl = variant.value<CUrl>();
|
||||
break;
|
||||
case IndexWasLoaded:
|
||||
this->m_wasLoaded = variant.toBool();
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
break;
|
||||
case IndexDbRootDirectory: this->m_dbRootDirectoryUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
||||
case IndexDbHttpPort: this->m_dbHttpPort = variant.toInt(); break;
|
||||
case IndexDbHttpsPort: this->m_dbHttpsPort = variant.toInt(); break;
|
||||
case IndexDbLoginService: break; // cannot be changed
|
||||
case IndexDbClientPingService: break; // cannot be changed
|
||||
case IndexVatsimData: this->m_vatsimDataFileUrls = variant.value<CUrlList>(); break;
|
||||
case IndexVatsimBookings: this->m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
|
||||
case IndexVatsimMetars: this->m_vatsimMetarsUrls = variant.value<CUrlList>(); break;
|
||||
case IndexSharedUrls: this->m_sharedUrls = variant.value<CUrlList>(); break;
|
||||
case IndexNewsUrls: this->m_newsUrls = variant.value<CUrlList>(); break;
|
||||
case IndexOnlineHelpUrls: this->m_onlineHelpUrls = variant.value<CUrlList>(); break;
|
||||
case IndexSwiftMapUrls: this->m_mapUrls = variant.value<CUrlList>(); break;
|
||||
case IndexCrashReportServerUrl: this->m_crashReportServerUrl = variant.value<CUrl>(); break;
|
||||
case IndexWasLoaded: this->m_wasLoaded = variant.toBool(); break;
|
||||
default: CValueObject::setPropertyByIndex(index, variant); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ namespace BlackCore
|
||||
connect(&m_updateTimer, &QTimer::timeout, this, &CNetworkWatchdog::doWork);
|
||||
}
|
||||
|
||||
void CNetworkWatchdog::setDbAccessibility(bool available)
|
||||
void CNetworkWatchdog::setDbAccessibility(bool accessible)
|
||||
{
|
||||
m_dbAccessible = available;
|
||||
m_dbAccessible = accessible;
|
||||
m_internetAccessible = m_internetAccessible && m_networkAccessible;
|
||||
QTimer::singleShot(0, &m_updateTimer, [this] { this->m_updateTimer.start(); }); // restart
|
||||
}
|
||||
@@ -52,7 +52,7 @@ namespace BlackCore
|
||||
int CNetworkWatchdog::triggerCheck()
|
||||
{
|
||||
if (!this->doWorkCheck()) return false; // senseless
|
||||
if (m_checkInProgress) return -1;
|
||||
if (m_checkInProgress) { return -1; }
|
||||
|
||||
const int n = this->getCheckCount();
|
||||
QTimer::singleShot(0, this, &CNetworkWatchdog::doWork);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace BlackCore
|
||||
//! Set DB as avialable (from external)
|
||||
//! \remark if data was read from DB, this can save another check
|
||||
//! \threadsafe
|
||||
void setDbAccessibility(bool available);
|
||||
void setDbAccessibility(bool accessible);
|
||||
|
||||
//! DB is accessible
|
||||
//! \threadsafe
|
||||
|
||||
@@ -107,31 +107,21 @@ namespace BlackMisc
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); }
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case IndexName:
|
||||
return CVariant::fromValue(m_name);
|
||||
case IndexMachineIdBase64:
|
||||
return CVariant::fromValue(m_machineIdBase64);
|
||||
case IndexMachineName:
|
||||
return CVariant::fromValue(getMachineName());
|
||||
case IndexMachineId:
|
||||
return CVariant::fromValue(getMachineId());
|
||||
case IndexProcessId:
|
||||
return CVariant::fromValue(m_processId);
|
||||
case IndexProcessName:
|
||||
return CVariant::fromValue(m_processName);
|
||||
case IndexIsFromLocalMachine:
|
||||
return CVariant::fromValue(isFromLocalMachine());
|
||||
case IndexIsFromSameProcess:
|
||||
return CVariant::fromValue(isFromSameProcess());
|
||||
case IndexIsFromSameProcessName:
|
||||
return CVariant::fromValue(isFromSameProcessName());
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
case IndexName: return CVariant::fromValue(m_name);
|
||||
case IndexMachineIdBase64: return CVariant::fromValue(m_machineIdBase64);
|
||||
case IndexMachineName: return CVariant::fromValue(getMachineName());
|
||||
case IndexMachineId: return CVariant::fromValue(getMachineId());
|
||||
case IndexProcessId: return CVariant::fromValue(m_processId);
|
||||
case IndexProcessName: return CVariant::fromValue(m_processName);
|
||||
case IndexIsFromLocalMachine: return CVariant::fromValue(isFromLocalMachine());
|
||||
case IndexIsFromSameProcess: return CVariant::fromValue(isFromSameProcess());
|
||||
case IndexIsFromSameProcessName: return CVariant::fromValue(isFromSameProcessName());
|
||||
default: return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -410,7 +410,6 @@ namespace BlackMisc
|
||||
QPointer<T> m_weak;
|
||||
CConnectionGuard m_guard;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user