chore(cpn): Increase number of profiles that can be created (#4373)

This commit is contained in:
philmoz
2023-12-06 10:45:24 +10:00
committed by GitHub
parent 8e8feca046
commit 5d8ffcc244
5 changed files with 231 additions and 178 deletions
+17
View File
@@ -304,6 +304,11 @@ Profile::Profile() : CompStoreObj(), index(-1)
CompStoreObj::addObjectMapping(propertyGroup(), this);
}
Profile::Profile(const Profile & rhs) : CompStoreObj(), index(-1)
{
*this = rhs;
}
// The default copy operator can not be used since the index variable would be destroyed
Profile & Profile::operator= (const Profile & rhs)
{
@@ -661,6 +666,18 @@ QMap<int, QString> AppData::getActiveProfiles() const
return active;
}
void AppData::moveCurrentProfileToTop()
{
if (g.sortProfiles() && m_sessionId > 0) {
Profile tmpProfile(g.profile[m_sessionId]);
for (int i = m_sessionId; i > 0; i -= 1) {
g.profile[i] = g.profile[i - 1];
}
g.profile[0] = tmpProfile;
id(0);
}
}
void AppData::convertSettings(QSettings & settings)
{
quint32 savedVer = settings.value(SETTINGS_VERSION_KEY, 0).toUInt();