From 22773a6dd64877e64a3685fee79757f5031aa728 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 12 Jun 2016 13:52:28 +0200 Subject: [PATCH] Changed: Backup old profiles to compare with updated ones --- code/ryzom/tools/client/ryzom_installer/src/configfile.cpp | 5 +++++ code/ryzom/tools/client/ryzom_installer/src/configfile.h | 4 ++++ .../ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp | 1 + 3 files changed, 10 insertions(+) diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp index 048074d4c..88fae2388 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.cpp @@ -258,6 +258,11 @@ const CServer& CConfigFile::getServer(const QString &id) const return getServer(); } +void CConfigFile::backupProfiles() +{ + m_backupProfiles = m_profiles; +} + int CConfigFile::getProfilesCount() const { return m_profiles.size(); diff --git a/code/ryzom/tools/client/ryzom_installer/src/configfile.h b/code/ryzom/tools/client/ryzom_installer/src/configfile.h index d95894fae..67c1a5547 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/configfile.h +++ b/code/ryzom/tools/client/ryzom_installer/src/configfile.h @@ -118,6 +118,9 @@ public: CProfiles getProfiles() const { return m_profiles; } void setProfiles(const CProfiles &profiles) { m_profiles = profiles; } + CProfiles getBackupProfiles() const { return m_backupProfiles; } + void backupProfiles(); + int getProfilesCount() const; CProfile getProfile(int i = -1) const; void setProfile(int i, const CProfile &profile); @@ -193,6 +196,7 @@ private: CServers m_servers; CProfiles m_profiles; + CProfiles m_backupProfiles; QString m_installationDirectory; QString m_srcDirectory; diff --git a/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp b/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp index 42f07ad4c..3b8441381 100644 --- a/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp +++ b/code/ryzom/tools/client/ryzom_installer/src/profilesmodel.cpp @@ -57,6 +57,7 @@ bool CProfilesModel::removeRows(int row, int count, const QModelIndex &parent) bool CProfilesModel::save() const { + CConfigFile::getInstance()->backupProfiles(); CConfigFile::getInstance()->setProfiles(m_profiles); CConfigFile::getInstance()->save();