| 31 | #endif |
| 32 | |
| 33 | bool Common::removePath(const QString &path) |
| 34 | { |
| 35 | bool result = true; |
| 36 | QFileInfo info(path); |
| 37 | if (info.isDir()) { |
| 38 | QDir dir(path); |
| 39 | foreach (const QString &entry, dir.entryList(QDir::AllDirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot)) { |
| 40 | result &= removePath(dir.absoluteFilePath(entry)); |
| 41 | } |
| 42 | if (!info.dir().rmdir(info.fileName())) |
| 43 | return false; |
| 44 | } else { |
| 45 | result = QFile::remove(path); |
| 46 | } |
| 47 | return result; |
| 48 | } |
| 49 | |
| 50 | /** @brief Matches domain (assumes both pattern and domain not starting with dot) |
| 51 | * @param pattern = domain to be matched |