| 148 | } |
| 149 | |
| 150 | void Contest::clearPath(const QString &curDir) { |
| 151 | QDir dir(curDir); |
| 152 | QStringList fileList = dir.entryList(QDir::Files); |
| 153 | |
| 154 | for (int i = 0; i < fileList.size(); i++) { |
| 155 | if (! dir.remove(fileList[i])) { |
| 156 | #ifdef Q_OS_WIN32 |
| 157 | QProcess::execute(QString("attrib"), QStringList("-R") + QStringList(curDir + fileList[i])); |
| 158 | #else |
| 159 | QProcess::execute(QString("chmod"), QStringList("+w") + QStringList(curDir + fileList[i])); |
| 160 | #endif |
| 161 | dir.remove(fileList[i]); |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | QStringList dirList = dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); |
| 166 | |
| 167 | for (int i = 0; i < dirList.size(); i++) { |
| 168 | clearPath(curDir + dirList[i] + QDir::separator()); |
| 169 | dir.rmdir(dirList[i]); |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | void Contest::judge(const QVector<std::pair<Contestant *, int>> &judgingTasks) { |
| 174 | LOG("Start Judging"); |
nothing calls this directly
no outgoing calls
no test coverage detected