Changed: Only remove directories if not empty path

--HG--
branch : develop
This commit is contained in:
kervala 2016-06-14 19:49:03 +02:00
parent f36c00cd00
commit 7535b41f45

View file

@ -722,6 +722,8 @@ void COperationDialog::deleteComponentsServers()
QString path = server.getDirectory();
if (!path.isEmpty())
{
QDir dir(path);
if (dir.exists() && !dir.removeRecursively())
@ -730,6 +732,7 @@ void COperationDialog::deleteComponentsServers()
return;
}
}
}
emit success(m_components.servers.size());
emit done();
@ -761,11 +764,16 @@ void COperationDialog::deleteComponentsProfiles()
QString path = profile.getDirectory();
if (!path.isEmpty())
{
QDir dir(path);
if (dir.exists() && !dir.removeRecursively())
{
emit fail(tr("Unable to delete files for profile %1").arg(profile.name));
return;
}
}
// delete profile
config->removeProfile(profileId);