3_2_x mapping: [search engine] Remove python3 cache during updateNova()

This commit is contained in:
DoumanAsh
2015-06-13 08:46:52 +03:00
parent 23842a8ec3
commit aac6a4526c
3 changed files with 27 additions and 2 deletions

View File

@@ -187,6 +187,27 @@ bool fsutils::forceRemove(const QString& file_path) {
return f.remove();
}
/**
* Removes directory and its content recursively.
*
*/
void fsutils::removeDirRecursive(const QString& dirName) {
QDir dir(dirName);
if (!dir.exists()) return;
Q_FOREACH(QFileInfo info, dir.entryInfoList(QDir::NoDotAndDotDot |
QDir::System |
QDir::Hidden |
QDir::AllDirs |
QDir::Files, QDir::DirsFirst)) {
if (info.isDir()) removeDirRecursive(info.absoluteFilePath());
else forceRemove(info.absoluteFilePath());
}
dir.rmdir(dirName);
}
/**
* Returns the size of a file.
* If the file is a folder, it will compute its size based on its content.