mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 09:36:15 +00:00
Changed: Only remove directories if not empty path
This commit is contained in:
parent
092b4593f3
commit
a137f542c8
1 changed files with 16 additions and 8 deletions
|
@ -722,6 +722,8 @@ void COperationDialog::deleteComponentsServers()
|
||||||
|
|
||||||
QString path = server.getDirectory();
|
QString path = server.getDirectory();
|
||||||
|
|
||||||
|
if (!path.isEmpty())
|
||||||
|
{
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
|
|
||||||
if (dir.exists() && !dir.removeRecursively())
|
if (dir.exists() && !dir.removeRecursively())
|
||||||
|
@ -730,6 +732,7 @@ void COperationDialog::deleteComponentsServers()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
emit success(m_components.servers.size());
|
emit success(m_components.servers.size());
|
||||||
emit done();
|
emit done();
|
||||||
|
@ -761,11 +764,16 @@ void COperationDialog::deleteComponentsProfiles()
|
||||||
|
|
||||||
QString path = profile.getDirectory();
|
QString path = profile.getDirectory();
|
||||||
|
|
||||||
|
if (!path.isEmpty())
|
||||||
|
{
|
||||||
|
QDir dir(path);
|
||||||
|
|
||||||
if (dir.exists() && !dir.removeRecursively())
|
if (dir.exists() && !dir.removeRecursively())
|
||||||
{
|
{
|
||||||
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
|
// delete profile
|
||||||
config->removeProfile(profileId);
|
config->removeProfile(profileId);
|
||||||
|
|
Loading…
Reference in a new issue