mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 13:35:34 +08:00
Ref T698, enable network stats for restricted distributions
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include "network.h"
|
||||
#include "blackcore/application.h"
|
||||
#include "blackmisc/fileutils.h"
|
||||
#include "blackmisc/directoryutils.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
@@ -115,4 +116,15 @@ namespace BlackCore
|
||||
return CFileUtils::writeStringToFile(s, fp);
|
||||
}
|
||||
|
||||
void INetwork::connectedToNewtork()
|
||||
{
|
||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||
if (!m_statistics && (CBuildConfig::isLocalDeveloperDebugBuild() || sApp->getOwnDistribution().isRestricted()))
|
||||
{
|
||||
// enable for local and restricted versions (alpha, ...)
|
||||
CLogMessage("Enabled network statistics");
|
||||
m_statistics = true;
|
||||
}
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
@@ -603,6 +603,9 @@ namespace BlackCore
|
||||
//! Save the statistics
|
||||
bool saveNetworkStatistics(const QString &server);
|
||||
|
||||
//! Connected to network
|
||||
void connectedToNewtork();
|
||||
|
||||
private:
|
||||
bool m_statistics = false;
|
||||
QMap <QString, int> m_callStatistics;
|
||||
|
||||
@@ -293,6 +293,7 @@ namespace BlackCore
|
||||
{
|
||||
m_server.setConnectedSinceNow();
|
||||
this->setCurrentEcosystem(m_server.getEcosystem());
|
||||
this->connectedToNewtork();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user