From 811aa1967d2c972dd21b40e0f087f581c4caba88 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 16 May 2016 14:45:43 +0200 Subject: [PATCH] Changed: Profile ID is now a QString --- code/ryzom/tools/client/ryzom_installer/src/configfile.cpp | 4 ++-- code/ryzom/tools/client/ryzom_installer/src/configfile.h | 3 +-- .../ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp | 2 +- code/ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp | 4 ++-- code/ryzom/tools/client/ryzom_installer/src/profilesmodel.h | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 29c7ba6e4..141fef5e3 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -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; } diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index e225fcc59..8909e39e6 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -46,12 +46,11 @@ struct CProfile { CProfile() { - id = -1; desktopShortcut = false; menuShortcut = false; } - int id; + QString id; QString account; QString name; QString server; diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp index c83447d47..fd9d64a10 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesdialog.cpp @@ -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)); diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp b/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp index 64f15c5d5..bdc0fbe23 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp @@ -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; diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.h b/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.h index ea02f618c..4a3a71a77 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.h +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.h @@ -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;