Something like this should work.
void someFunction()
{
QString pathTest
= "C:/temp/artist1";
remove(pathTest);
}
{
if(fileInfo.isDir()){
for(int i = 0; i < fileList.count(); ++i){
remove(fileList.at(i));
}
dir.rmdir(path);
}
else{
}
}
void someFunction()
{
QString pathTest = "C:/temp/artist1";
remove(pathTest);
}
void remove(const QString &path)
{
QFileInfo fileInfo(path);
if(fileInfo.isDir()){
QDir dir(path);
QStringList fileList = dir.entryList();
for(int i = 0; i < fileList.count(); ++i){
remove(fileList.at(i));
}
dir.rmdir(path);
}
else{
QFile::remove(path);
}
}
To copy to clipboard, switch view to plain text mode
I thought the code was pretty much self-explanatory
Bookmarks