- else if (line.contains("entity", Qt::CaseInsensitive)) {\r
- QRegularExpression rxEnt("^entity (.+) is$",QRegularExpression::CaseInsensitiveOption);\r
- QRegularExpressionMatch matchEnt = rxEnt.match(line);\r
- if (matchEnt.hasMatch()) {\r
- QString entityName = matchEnt.captured(1);\r
- cout << "found entity " << qPrintable(entityName) << endl;\r
- availableSources.append(new ExternalSource(entityName,fileName,ExternalSource::Code));\r
+ QTextStream in(&srcXML);\r
+\r
+ QString line = in.readLine();\r
+ while (!line.isNull()) {\r
+ if (line.contains("package", Qt::CaseInsensitive)) {\r
+ QRegularExpression rxPack("^package (.+) is$",QRegularExpression::CaseInsensitiveOption);\r
+ QRegularExpressionMatch matchPack = rxPack.match(line);\r
+ if (matchPack.hasMatch()) {\r
+ QString packName = matchPack.captured(1);\r
+ cout << "found package " << qPrintable(packName) << endl;\r
+ availableResources.append(new ExternalResource(packName,fileName,ExternalResource::Package));\r
+ }\r
+ }\r
+ else if (line.contains("entity", Qt::CaseInsensitive)) {\r
+ QRegularExpression rxEnt("^entity (.+) is$",QRegularExpression::CaseInsensitiveOption);\r
+ QRegularExpressionMatch matchEnt = rxEnt.match(line);\r
+ if (matchEnt.hasMatch()) {\r
+ QString entityName = matchEnt.captured(1);\r
+ cout << "found entity " << qPrintable(entityName) << endl;\r
+ availableResources.append(new ExternalResource(entityName,fileName,ExternalResource::Code));\r
+ }\r