mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
25 lines
536 B
C++
25 lines
536 B
C++
#include "custom_widgets.h"
|
|
|
|
#include <QDir>
|
|
#include <QFileInfo>
|
|
|
|
void delTree(QDir dir)
|
|
{
|
|
dir.setFilter(QDir::AllDirs|QDir::Files|QDir::Hidden|QDir::NoDotAndDotDot);
|
|
QFileInfoList list = dir.entryInfoList();
|
|
for (int i = 0; i < list.size(); ++i)
|
|
{
|
|
QFileInfo fileInfo = list.at(i);
|
|
QString path = fileInfo.filePath();
|
|
if(fileInfo.isDir())
|
|
{
|
|
delTree(QDir(fileInfo.absoluteFilePath()));
|
|
dir.rmdir(fileInfo.absoluteFilePath());
|
|
}
|
|
else
|
|
{
|
|
dir.remove(fileInfo.absoluteFilePath());
|
|
}
|
|
}
|
|
}
|