From 0eb05c83914f4785163be7b13a52df4f28e86a21 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Wed, 7 Jan 2015 23:09:17 +0100 Subject: [PATCH] Look at to fix bug about language in template --- templateparser/templateparser.cpp | 7 +++++++ templateparser/templateparser.h | 2 +- templateparser/templatesutil.cpp | 6 ++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/templateparser/templateparser.cpp b/templateparser/templateparser.cpp index 99ef96844b..b7dea80bb7 100644 --- a/templateparser/templateparser.cpp +++ b/templateparser/templateparser.cpp @@ -311,6 +311,13 @@ void TemplateParser::processWithTemplate( const QString &tmpl ) QString q; int len = parseQuotes( QLatin1String("REM="), cmd, q ); i += len; + } else if ( cmd.startsWith( QLatin1String( "LANGUAGE=" ) ) ) { + QString q; + const int len = parseQuotes( QLatin1String("LANGUAGE="), cmd, q ); + i += len; + if (!q.isEmpty()) { + //TODO + } } else if ( cmd.startsWith( QLatin1String( "DICTIONARYLANGUAGE=" ) ) ) { QString q; const int len = parseQuotes( QLatin1String("DICTIONARYLANGUAGE="), cmd, q ); diff --git a/templateparser/templateparser.h b/templateparser/templateparser.h index 43d0405a36..b2c08268df 100644 --- a/templateparser/templateparser.h +++ b/templateparser/templateparser.h @@ -300,7 +300,7 @@ private: * smart quoting is turned on. Signed or encrypted texts * get converted to plain text when allowDecryption is true. */ - QString quotedPlainText( const QString & election=QString() ) const; + QString quotedPlainText( const QString & selection=QString() ) const; /** * Returns HTML message body. diff --git a/templateparser/templatesutil.cpp b/templateparser/templatesutil.cpp index 0ef1eedf03..a53951b978 100644 --- a/templateparser/templatesutil.cpp +++ b/templateparser/templatesutil.cpp @@ -50,7 +50,8 @@ QStringList TemplateParser::Util::keywordsWithArgs() << QLatin1String( "%TEXTPIPE=\"\"" ) << QLatin1String( "%OHEADER=\"\"" ) << QLatin1String( "%HEADER=\"\"" ) - << QLatin1String( "%DICTIONARYLANGUAGE=\"\"" ); + << QLatin1String( "%DICTIONARYLANGUAGE=\"\"" ) + << QLatin1String( "%LANGUAGE=\"\"" ); return keywordsWithArgs; } @@ -70,7 +71,8 @@ QStringList TemplateParser::Util::keywordsWithArgsForCompleter() << QLatin1String( "%TEXTPIPE=\".*\"" ) << QLatin1String( "%OHEADER=\".*\"" ) << QLatin1String( "%HEADER=\".*\"" ) - << QLatin1String( "%DICTIONARYLANGUAGE=\".*\"" ); + << QLatin1String( "%DICTIONARYLANGUAGE=\".*\"" ) + << QLatin1String( "%LANGUAGE=\".*\"" ); return keywordsWithArgs; } -- GitLab