From 1b1d78cf513f00310420d1652bcf6061525442a1 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Fri, 1 Apr 2016 15:30:16 +0200 Subject: [PATCH] Improve locale.gen file parser. --- src/modules/locale/LocalePage.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index 6b516efab..7a0e79109 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -246,13 +246,18 @@ LocalePage::init( const QString& initialRegion, } foreach ( QByteArray line, ba.split( '\n' ) ) { - if ( line.startsWith( "# " ) || line.simplified() == "#" ) + if ( line.startsWith( "## " ) || + line.startsWith( "# " ) || + line.simplified() == "#" ) continue; QString lineString = QString::fromLatin1( line.simplified() ); - if ( lineString.startsWith( "#" ) ) lineString.remove( '#' ); + lineString = lineString.simplified(); + + if ( lineString.isEmpty() ) + continue; m_localeGenLines.append( lineString ); }