Ref T698, enable network stats for restricted distributions

This commit is contained in:
Klaus Basan
2019-07-06 03:03:56 +02:00
parent e88520109f
commit fab0de3450
4 changed files with 22 additions and 1 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -293,6 +293,7 @@ namespace BlackCore
{
m_server.setConnectedSinceNow();
this->setCurrentEcosystem(m_server.getEcosystem());
this->connectedToNewtork();
}
else
{