Commit 1494faac authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against qt5.15 without deprecated method

parent 46810aac
......@@ -134,11 +134,11 @@ void KanjiBrowser::loadKanji()
}
// This conversion from QList to QSet to QList, is to remove duplicated items.
gradeList = gradeList.toSet().values();
strokeList = strokeList.toSet().values();
// Sort them.
std::sort(gradeList.begin(), gradeList.end());
gradeList.erase(std::unique(gradeList.begin(), gradeList.end()), gradeList.end());
std::sort(strokeList.begin(), strokeList.end());
strokeList.erase(std::unique(strokeList.begin(), strokeList.end()), strokeList.end());
qDebug() << "Max. grade:" << gradeList.last();
qDebug() << "Max. stroke count:" << strokeList.last();
......
......@@ -93,11 +93,16 @@ bool RadicalFile::loadRadicalFile( QString &radkfile )
{
// List of m_kanji, potentially
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QList<QString> m_kanjiList = line.trimmed().split( QLatin1String(""), QString::SkipEmptyParts );
const QList<QString> m_kanjiList = line.trimmed().split( QLatin1String(""), QString::SkipEmptyParts );
#else
QList<QString> m_kanjiList = line.trimmed().split( QLatin1String(""), Qt::SkipEmptyParts );
const QList<QString> m_kanjiList = line.trimmed().split( QLatin1String(""), Qt::SkipEmptyParts );
#endif
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
newestRadical->addKanji( m_kanjiList.toSet() );
#else
const QSet<QString> kanjiSet = QSet<QString>(m_kanjiList.begin(), m_kanjiList.end());
#endif
newestRadical->addKanji( kanjiSet );
foreach( const QString &kanji, m_kanjiList )
{
krad[ kanji ] += *newestRadical;
......
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