MCPcopy Create free account
hub / github.com/QNapi/qnapi / foreach

Function foreach

libqnapi/src/utils/encodingutils.cpp:144–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142 QString from;
143
144 foreach (QString codec, codecs) {
145 QTextCodec *tc = QTextCodec::codecForName(qPrintable(codec));
146
147 const QString text = tc->toUnicode(buffer.constData(), buffer.size());
148
149 QStringList chars = QString::fromUtf8("ą/ś/ż/ć/ń/ł/ó/ę").split("/");
150
151 int found = 0;
152
153 foreach (QString c, chars) {
154 if (text.contains(c, Qt::CaseInsensitive)) {
155 ++found;
156 }
157 }
158
159 if (found >= bestMatch) {
160 bestMatch = found;
161 from = codec;
162 }
163 }
164
165 return from;
166}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected