MCPcopy Create free account
hub / github.com/KDE/kdiff3 / insertCodec

Method insertCodec

src/optiondialog.cpp:403–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401 }
402
403 void insertCodec(const QString& visibleCodecName, const QByteArray& name)
404 {
405 const QLatin1String codecName = QLatin1String(name);
406
407 for(qsizetype i = 0; i < m_codecVec.size(); ++i)
408 {
409 if(name == m_codecVec[i])
410 return; // don't insert any codec twice
411 }
412 // The m_codecVec.size will at this point return the value we need for the index.
413 if(codecName == defaultName())
414 saveDefaultIndex(m_codecVec.size());
415 QString itemText = visibleCodecName.isEmpty() ? codecName : visibleCodecName + u8" (" + codecName + u8")";
416 addItem(itemText, m_codecVec.size());
417 m_codecVec.push_back(name);
418 }
419
420 void setToDefault() override
421 {

Callers

nothing calls this directly

Calls 4

saveDefaultIndexFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected