MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / load

Method load

tools/triage/mainwindow.cpp:129–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void MainWindow::load(QTextStream &textStream)
130{
131 bool local = false;
132 QString url;
133 QString errorMessage;
134 QStringList versions;
135 mAllErrors.clear();
136 while (true) {
137 QString line = textStream.readLine();
138 if (line.isNull())
139 break;
140 if (line.startsWith("ftp://") || line.startsWith("https://") || (line.startsWith(DACA2_PACKAGES) && line.endsWith(".tar.xz"))) {
141 local = line.startsWith(DACA2_PACKAGES) && line.endsWith(".tar.xz");
142 url = line;
143 if (!errorMessage.isEmpty())
144 mAllErrors << errorMessage;
145 errorMessage.clear();
146 } else if (!url.isEmpty()) {
147 static const QRegularExpression severityRe("^.*: (error|warning|style|note):.*$");
148 if (!severityRe.match(line).hasMatch())
149 continue;
150 if (!local) {
151 const QRegularExpressionMatch matchRes = mVersionRe.match(line);
152 if (matchRes.hasMatch()) {
153 const QString version = matchRes.captured(1);
154 if (versions.indexOf(version) < 0)
155 versions << version;
156 }
157 }
158 if (line.indexOf(": note:") > 0)
159 errorMessage += '\n' + line;
160 else if (errorMessage.isEmpty()) {
161 errorMessage = url + '\n' + line;
162 } else {
163 mAllErrors << errorMessage;
164 errorMessage = url + '\n' + line;
165 }
166 }
167 }
168 if (!errorMessage.isEmpty())
169 mAllErrors << errorMessage;
170
171 ui->version->clear();
172 if (versions.size() > 1)
173 ui->version->addItem("");
174 ui->version->addItems(versions);
175
176 filter("");
177}
178
179void MainWindow::refreshResults()
180{

Callers 5

getConfigsStrMethod · 0.45
fixture.cppFile · 0.45
loadxmldataMethod · 0.45
loadxmldocMethod · 0.45
mainFunction · 0.45

Calls 7

startsWithMethod · 0.80
endsWithMethod · 0.80
isEmptyMethod · 0.80
addItemMethod · 0.80
clearMethod · 0.45
matchMethod · 0.45
sizeMethod · 0.45

Tested by 1

getConfigsStrMethod · 0.36