Loop through files
| 92 | |
| 93 | //Loop through files |
| 94 | foreach (QFileInfo entry, entries) { |
| 95 | if (entry.isDir()) { |
| 96 | //If the entry is a folder, call the browseRecursively function again |
| 97 | QDir dir(entry.filePath()); |
| 98 | QString mainClass = getEntryFilePath(dir); |
| 99 | if (!mainClass.isEmpty()) |
| 100 | return mainClass; |
| 101 | } else { |
| 102 | if (entry.suffix().toLower() == "py") { |
| 103 | QFile file(entry.filePath()); |
| 104 | if (file.open(QIODevice::ReadOnly)) { |
| 105 | QString fileContent = file.readAll(); |
| 106 | file.close(); |
| 107 | //Check if the given regular expression matches the file content |
| 108 | if (regExp.indexIn(fileContent) >= 0) { |
| 109 | return entry.filePath(); |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | return {}; |
| 116 | } |
| 117 |