Axivion: Rename functions

We do no more store the token inside QC settings.
Reflect that within source as well.

Change-Id: I55097336bc9fe440ee1afc5336ae094ce0eb00d6
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2024-09-18 09:20:57 +02:00
parent 4d4ccb51a3
commit a969eee857

View File

@@ -69,13 +69,13 @@ AxivionServer AxivionServer::fromJson(const QJsonObject &json)
return {Id::fromString(id.toString()), fixUrl(dashboard.toString()), username.toString()}; return {Id::fromString(id.toString()), fixUrl(dashboard.toString()), username.toString()};
} }
static FilePath tokensFilePath() static FilePath axivionJsonFilePath()
{ {
return FilePath::fromString(ICore::settings()->fileName()).parentDir() return FilePath::fromString(ICore::settings()->fileName()).parentDir()
.pathAppended("qtcreator/axivion.json"); .pathAppended("qtcreator/axivion.json");
} }
static void writeTokenFile(const FilePath &filePath, const QList<AxivionServer> &servers) static void writeAxivionJson(const FilePath &filePath, const QList<AxivionServer> &servers)
{ {
QJsonDocument doc; QJsonDocument doc;
QJsonArray serverArray; QJsonArray serverArray;
@@ -87,7 +87,7 @@ static void writeTokenFile(const FilePath &filePath, const QList<AxivionServer>
filePath.setPermissions(QFile::ReadUser | QFile::WriteUser); filePath.setPermissions(QFile::ReadUser | QFile::WriteUser);
} }
static QList<AxivionServer> readTokenFile(const FilePath &filePath) static QList<AxivionServer> readAxivionJson(const FilePath &filePath)
{ {
if (!filePath.exists()) if (!filePath.exists())
return {}; return {};
@@ -129,7 +129,7 @@ AxivionSettings::AxivionSettings()
m_defaultServerId.setSettingsKey("DefaultDashboardId"); m_defaultServerId.setSettingsKey("DefaultDashboardId");
AspectContainer::readSettings(); AspectContainer::readSettings();
m_allServers = readTokenFile(tokensFilePath()); m_allServers = readAxivionJson(axivionJsonFilePath());
if (m_allServers.size() == 1 && m_defaultServerId().isEmpty()) // handle settings transition if (m_allServers.size() == 1 && m_defaultServerId().isEmpty()) // handle settings transition
m_defaultServerId.setValue(m_allServers.first().id.toString()); m_defaultServerId.setValue(m_allServers.first().id.toString());
@@ -137,7 +137,7 @@ AxivionSettings::AxivionSettings()
void AxivionSettings::toSettings() const void AxivionSettings::toSettings() const
{ {
writeTokenFile(tokensFilePath(), m_allServers); writeAxivionJson(axivionJsonFilePath(), m_allServers);
AspectContainer::writeSettings(); AspectContainer::writeSettings();
} }