mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-23 07:16:15 +00:00
Changed: Profile ID is now a QString
This commit is contained in:
parent
577680c85c
commit
811aa1967d
5 changed files with 8 additions and 9 deletions
|
@ -105,7 +105,7 @@ bool CConfigFile::load(const QString &filename)
|
|||
|
||||
settings.beginGroup(QString("profile_%1").arg(i));
|
||||
|
||||
profile.id = settings.value("id").toInt();
|
||||
profile.id = settings.value("id").toString();
|
||||
profile.name = settings.value("name").toString();
|
||||
profile.account = settings.value("account").toString();
|
||||
profile.server = settings.value("server").toString();
|
||||
|
@ -590,7 +590,7 @@ CConfigFile::InstallationStep CConfigFile::getNextStep() const
|
|||
}
|
||||
|
||||
// no default profile
|
||||
if (profile.id < 0)
|
||||
if (profile.id.isEmpty())
|
||||
{
|
||||
return CreateProfile;
|
||||
}
|
||||
|
|
|
@ -46,12 +46,11 @@ struct CProfile
|
|||
{
|
||||
CProfile()
|
||||
{
|
||||
id = -1;
|
||||
desktopShortcut = false;
|
||||
menuShortcut = false;
|
||||
}
|
||||
|
||||
int id;
|
||||
QString id;
|
||||
QString account;
|
||||
QString name;
|
||||
QString server;
|
||||
|
|
|
@ -97,7 +97,7 @@ void CProfilesDialog::displayProfile(int index)
|
|||
const CProfile &profile = m_model->getProfiles()[index];
|
||||
|
||||
// update all widgets with content of profile
|
||||
profileIdLabel->setText(QString::number(profile.id));
|
||||
profileIdLabel->setText(profile.id);
|
||||
accountEdit->setText(profile.account);
|
||||
nameEdit->setText(profile.name);
|
||||
serverComboBox->setCurrentIndex(m_serversModel->getIndexFromServerID(profile.server));
|
||||
|
|
|
@ -48,7 +48,7 @@ bool CProfilesModel::save() const
|
|||
return true;
|
||||
}
|
||||
|
||||
int CProfilesModel::getIndexFromProfileID(int profileId) const
|
||||
int CProfilesModel::getIndexFromProfileID(const QString &profileId) const
|
||||
{
|
||||
for(int i = 0; i < m_profiles.size(); ++i)
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ int CProfilesModel::getIndexFromProfileID(int profileId) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
int CProfilesModel::getProfileIDFromIndex(int index) const
|
||||
QString CProfilesModel::getProfileIDFromIndex(int index) const
|
||||
{
|
||||
if (index < 0 || index >= m_profiles.size()) return -1;
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ public:
|
|||
|
||||
bool save() const;
|
||||
|
||||
int getIndexFromProfileID(int profileId) const;
|
||||
int getProfileIDFromIndex(int index) const;
|
||||
int getIndexFromProfileID(const QString &profileId) const;
|
||||
QString getProfileIDFromIndex(int index) const;
|
||||
|
||||
private:
|
||||
CProfiles m_profiles;
|
||||
|
|
Loading…
Reference in a new issue