mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 09:19:01 +00:00
Changed: Backup old profiles to compare with updated ones
This commit is contained in:
parent
a2d9be979d
commit
9c6369b833
3 changed files with 10 additions and 0 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue