Changed: Methods to convert index from/to profile ID
--HG-- branch : feature-ryzom-installer
This commit is contained in:
parent
733969f148
commit
b98f625e7a
2 changed files with 20 additions and 0 deletions
|
@ -46,3 +46,20 @@ bool CProfilesModel::save() const
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CProfilesModel::getIndexFromProfileID(int profileId) const
|
||||||
|
{
|
||||||
|
for(int i = 0; i < m_profiles.size(); ++i)
|
||||||
|
{
|
||||||
|
if (m_profiles[i].id == profileId) return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CProfilesModel::getProfileIDFromIndex(int index) const
|
||||||
|
{
|
||||||
|
if (index < 0 || index >= m_profiles.size()) return -1;
|
||||||
|
|
||||||
|
return m_profiles[index].id;
|
||||||
|
}
|
||||||
|
|
|
@ -25,6 +25,9 @@ public:
|
||||||
|
|
||||||
bool save() const;
|
bool save() const;
|
||||||
|
|
||||||
|
int getIndexFromProfileID(int profileId) const;
|
||||||
|
int getProfileIDFromIndex(int index) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CProfiles m_profiles;
|
CProfiles m_profiles;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue