Changed: Remove a profile

This commit is contained in:
kervala 2016-06-14 19:46:18 +02:00
parent 29b5fd8047
commit 092b4593f3
3 changed files with 11 additions and 1 deletions

View file

@ -313,8 +313,14 @@ int CConfigFile::addProfile(const CProfile &profile)
void CConfigFile::removeProfile(int i) void CConfigFile::removeProfile(int i)
{ {
m_profiles.removeAt(i); m_profiles.removeAt(i);
}
// TODO: decalle all profiles and move files void CConfigFile::removeProfile(const QString &id)
{
for (int i = 0; i < m_profiles.size(); ++i)
{
if (m_profiles[i].id == id) removeProfile(i);
}
} }
bool CConfigFile::has64bitsOS() bool CConfigFile::has64bitsOS()

View file

@ -116,6 +116,7 @@ public:
void setProfile(int i, const CProfile &profile); void setProfile(int i, const CProfile &profile);
int addProfile(const CProfile &profile); int addProfile(const CProfile &profile);
void removeProfile(int i); void removeProfile(int i);
void removeProfile(const QString &id);
int getDefaultServerIndex() const; int getDefaultServerIndex() const;
void setDefaultServerIndex(int index); void setDefaultServerIndex(int index);

View file

@ -766,6 +766,9 @@ void COperationDialog::deleteComponentsProfiles()
emit fail(tr("Unable to delete files for profile %1").arg(profile.name)); emit fail(tr("Unable to delete files for profile %1").arg(profile.name));
return; return;
} }
// delete profile
config->removeProfile(profileId);
} }
emit success(m_components.servers.size()); emit success(m_components.servers.size());