MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / foreach

Function foreach

src/plugins/python/python/pythongenerator.cpp:94–114  ·  view source on GitHub ↗

Loop through files

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

getEntryFilePathFunction · 0.85
readAllMethod · 0.80
filePathMethod · 0.45
isEmptyMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected