Commit b350402f authored by Ragnar Thomsen's avatar Ragnar Thomsen Committed by Michael Reeves

Fix a segfault when opening encoding menu

This was caused by QTextCodec::codecForName("System") returning a null
pointer.
parent e29d3a4b
......@@ -2076,8 +2076,10 @@ void EncodingLabel::mousePressEvent(QMouseEvent *)
QList<int> codecEnumList;
// Adding "main" encodings
insertCodec( i18n("Unicode, 8 bit"), QTextCodec::codecForName("UTF-8"), codecEnumList, m_pContextEncodingMenu, currentTextCodecEnum);
insertCodec( "", QTextCodec::codecForName("System"), codecEnumList, m_pContextEncodingMenu, currentTextCodecEnum);
insertCodec(i18n("Unicode, 8 bit"), QTextCodec::codecForName("UTF-8"), codecEnumList, m_pContextEncodingMenu, currentTextCodecEnum);
if (QTextCodec::codecForName("System")) {
insertCodec(QString(), QTextCodec::codecForName("System"), codecEnumList, m_pContextEncodingMenu, currentTextCodecEnum);
}
// Adding recent encodings
if (m_pOptions!=0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment