forked from qt-creator/qt-creator
Axivion: Replace local lambda with static method
No need to create lambda on every call to credentialKey(). This should remove the warning about the Performance inefficiencies (AUTO_CAUSES_COPY). Change-Id: I9a7dc9cabcc6f80e58e39ef8be6a5445a11e0433 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -119,13 +119,15 @@ static QString apiTokenDescription()
|
|||||||
return "Automatically created by " + ua + " on " + user + "@" + QSysInfo::machineHostName();
|
return "Automatically created by " + ua + " on " + user + "@" + QSysInfo::machineHostName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QString escapeKey(const QString &string)
|
||||||
|
{
|
||||||
|
QString escaped = string;
|
||||||
|
return escaped.replace('\\', "\\\\").replace('@', "\\@");
|
||||||
|
}
|
||||||
|
|
||||||
static QString credentialKey()
|
static QString credentialKey()
|
||||||
{
|
{
|
||||||
const auto escape = [](const QString &string) {
|
return escapeKey(settings().server.username) + '@' + escapeKey(settings().server.dashboard);
|
||||||
QString escaped = string;
|
|
||||||
return escaped.replace('\\', "\\\\").replace('@', "\\@");
|
|
||||||
};
|
|
||||||
return escape(settings().server.username) + '@' + escape(settings().server.dashboard);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename DtoType>
|
template <typename DtoType>
|
||||||
|
Reference in New Issue
Block a user