[SCM] Grantlee template engine packaging branch, master, updated. debian/0.3.0-3-3-gb6c0f8b
Pino Toscano
pino at alioth.debian.org
Wed May 15 08:42:16 UTC 2013
Gitweb-URL: http://git.debian.org/?p=pkg-kde/krap/grantlee.git;a=commitdiff;h=b6c0f8b
The following commit has been merged in the master branch:
commit b6c0f8b2b88c05bc639de6f6f0aeb48006baf775
Author: Pino Toscano <pino at debian.org>
Date: Wed May 15 10:41:48 2013 +0200
fix Grantlee on architectures where qreal=float
---
debian/changelog | 2 +
debian/patches/series | 2 +
debian/patches/testinternationalization-qreal.diff | 21 ++++++++
debian/patches/variantIsTrue-float-fix.diff | 50 ++++++++++++++++++++
4 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index e4ef423..6f1ccaf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ grantlee (0.3.0-4) UNRELEASED; urgency=low
[ Pino Toscano ]
* Update symbols files.
+ * Fix Grantlee on architectures where qreal is not double but float; patches
+ variantIsTrue-float-fix.diff and testinternationalization-qreal.diff.
-- Debian Krap Maintainers <debian-qt-kde at lists.debian.org> Tue, 14 May 2013 15:25:24 +0200
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..f3b7f64
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+variantIsTrue-float-fix.diff
+testinternationalization-qreal.diff
diff --git a/debian/patches/testinternationalization-qreal.diff b/debian/patches/testinternationalization-qreal.diff
new file mode 100644
index 0000000..07daddd
--- /dev/null
+++ b/debian/patches/testinternationalization-qreal.diff
@@ -0,0 +1,21 @@
+Author: Pino Toscano <toscano.pino at tiscali.it>
+Description: TestInternationalization: fix the double data in testFloats
+ 7.4 is a double value, and the data expected is qreal; while this is
+ not an issue on platforms where qreal is double, this causes a type
+ mismatch where qreal is float (for example on arm and sh).
+ .
+ The easy fix is just to cast 4.2 as qreal.
+Last-Update: 2013-05-15
+Forwarded: https://www.gitorious.org/grantlee/grantlee/merge_requests/10
+
+--- a/templates/tests/testinternationalization.cpp
++++ b/templates/tests/testinternationalization.cpp
+@@ -798,7 +798,7 @@ void TestInternationalization::testFloat
+ QTest::addColumn<QString>("frFloatingPoint");
+
+ QTest::newRow("float-01")
+- << 7.4
++ << qreal(7.4)
+ << QString::fromLatin1("7.4")
+ << QString::fromLatin1("7.40")
+ << QString::fromLatin1("7.40")
diff --git a/debian/patches/variantIsTrue-float-fix.diff b/debian/patches/variantIsTrue-float-fix.diff
new file mode 100644
index 0000000..5f288ea
--- /dev/null
+++ b/debian/patches/variantIsTrue-float-fix.diff
@@ -0,0 +1,50 @@
+Author: Pino Toscano <toscano.pino at tiscali.it>
+Description: Fix variantIsTrue for float variants
+ Grantlee::variantIsTrue() was not properly checking whether a QVariant
+ containing a float (for example a qreal on arm and sh platforms)
+ is a true value, simply because its type was not be handled in the type
+ switch, and thus it was handled as string.
+ Adding the QMetaType::Float case and extracting the float as such from
+ the variant fixes the issue.
+ .
+ The test data for TestDefaultTags::testIfTag() has been expaded to
+ include if-truthiness data explicitly for double and float values,
+ so the they can be both tested no matter what qreal is.
+Last-Update: 2013-05-14
+Forwarded: https://www.gitorious.org/grantlee/grantlee/merge_requests/10
+
+--- a/templates/lib/util.cpp
++++ b/templates/lib/util.cpp
+@@ -49,6 +49,9 @@ bool Grantlee::variantIsTrue( const QVar
+ case QVariant::Double: {
+ return ( variant.toDouble() > 0 );
+ }
++ case QMetaType::Float: {
++ return ( variant.toFloat() > 0 );
++ }
+ case QMetaType::QObjectStar: {
+ QObject *obj = variant.value<QObject *>();
+ if ( !obj )
+--- a/templates/tests/testdefaulttags.cpp
++++ b/templates/tests/testdefaulttags.cpp
+@@ -617,6 +617,20 @@ void TestDefaultTags::testIfTag_data()
+ dict.insert( QLatin1String( "var" ), r );
+ QTest::newRow( "if-truthiness10" ) << QString::fromLatin1( "{% if var %}Yes{% else %}No{% endif %}" ) << dict << QString::fromLatin1( "Yes" ) << NoError;
+
++ double d = 0.0;
++ dict.insert( QLatin1String( "var" ), d );
++ QTest::newRow( "if-truthiness11" ) << QString::fromLatin1( "{% if var %}Yes{% else %}No{% endif %}" ) << dict << QString::fromLatin1( "No" ) << NoError;
++ d = 7.1;
++ dict.insert( QLatin1String( "var" ), d );
++ QTest::newRow( "if-truthiness12" ) << QString::fromLatin1( "{% if var %}Yes{% else %}No{% endif %}" ) << dict << QString::fromLatin1( "Yes" ) << NoError;
++
++ float f = 0.0;
++ dict.insert( QLatin1String( "var" ), f );
++ QTest::newRow( "if-truthiness13" ) << QString::fromLatin1( "{% if var %}Yes{% else %}No{% endif %}" ) << dict << QString::fromLatin1( "No" ) << NoError;
++ f = 7.1;
++ dict.insert( QLatin1String( "var" ), f );
++ QTest::newRow( "if-truthiness14" ) << QString::fromLatin1( "{% if var %}Yes{% else %}No{% endif %}" ) << dict << QString::fromLatin1( "Yes" ) << NoError;
++
+ dict.clear();
+ QTest::newRow( "if-tag-badarg01" ) << QString::fromLatin1( "{% if x|default_if_none:y %}yes{% endif %}" ) << dict << QString() << NoError;
+
--
Grantlee template engine packaging
More information about the pkg-kde-commits
mailing list