[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [akonadi/dev/binary-protocol] src/server/storage: Adapt entities XSLT files to Tristate being in Ako
From: Dan_Vrátil <dvratil () redhat ! com>
Date: 2015-05-29 15:46:27
Message-ID: E1YyMUN-0008OD-EF () scm ! kde ! org
[Download RAW message or body]
Git commit 0f18f44c31a2748d35e95440fc08ee105866a628 by Dan Vrátil.
Committed on 29/05/2015 at 14:14.
Pushed by dvratil into branch 'dev/binary-protocol'.
Adapt entities XSLT files to Tristate being in Akonadi namespace now
M +27 -2 src/server/storage/entities-source.xsl
http://commits.kde.org/akonadi/0f18f44c31a2748d35e95440fc08ee105866a628
diff --git a/src/server/storage/entities-source.xsl \
b/src/server/storage/entities-source.xsl index 46ef3a6..3e611a5 100644
--- a/src/server/storage/entities-source.xsl
+++ b/src/server/storage/entities-source.xsl
@@ -205,7 +205,10 @@ bool <xsl:value-of select="$className"/>::operator==( const \
<xsl:value-of select
// accessor methods
<xsl:for-each select="column[@name != 'id']">
-<xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of \
select="$className"/>::<xsl:value-of select="@name"/>() const +<xsl:choose>
+ <xsl:when test="starts-with(@type, 'Tristate')">Akonadi::Tristate</xsl:when>
+ <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
+</xsl:choose><xsl:text> </xsl:text><xsl:value-of \
select="$className"/>::<xsl:value-of select="@name"/>() const {
<xsl:text>return d-></xsl:text><xsl:value-of select="@name"/>;
}
@@ -498,7 +501,15 @@ QDebug & operator<<( QDebug& d, const \
<xsl:value-of select="$class {
d << "[<xsl:value-of select="$className"/>: "
<xsl:for-each select="column">
- << "<xsl:value-of select="@name"/> = " << entity.<xsl:value-of \
select="@name"/>() + << "<xsl:value-of select="@name"/> = " <<
+ <xsl:choose>
+ <xsl:when test="starts-with(@type, 'Tristate')">
+ static_cast<int>(entity.<xsl:value-of select="@name"/>())
+ </xsl:when>
+ <xsl:otherwise>
+ entity.<xsl:value-of select="@name"/>()
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:if test="position() != last()"><< ", "</xsl:if>
</xsl:for-each>
<< "]";
@@ -522,7 +533,14 @@ bool <xsl:value-of select="$className"/>::insert( qint64* \
insertId ) </xsl:if>
<xsl:if test="$refColumn != 'id'">
if ( d-><xsl:value-of select="@name"/>_changed )
+ <xsl:choose>
+ <xsl:when test="starts-with(@type, 'Tristate')">
+ qb.setColumnValue( <xsl:value-of select="@name"/>Column(), \
static_cast<int>(this-><xsl:value-of select="@name"/>()) ); + \
</xsl:when> + <xsl:otherwise>
qb.setColumnValue( <xsl:value-of select="@name"/>Column(), \
this-><xsl:value-of select="@name"/>() ); + </xsl:otherwise>
+ </xsl:choose>
</xsl:if>
</xsl:for-each>
@@ -564,7 +582,14 @@ bool <xsl:value-of select="$className"/>::update()
qb.setColumnValue( <xsl:value-of select="@name"/>Column(), QVariant() );
else
</xsl:if>
+ <xsl:choose>
+ <xsl:when test="starts-with(@type, 'Tristate')">
+ qb.setColumnValue( <xsl:value-of select="@name"/>Column(), \
static_cast<int>(this-><xsl:value-of select="@name"/>()) ); + \
</xsl:when> + <xsl:otherwise>
qb.setColumnValue( <xsl:value-of select="@name"/>Column(), \
this-><xsl:value-of select="@name"/>() ); + </xsl:otherwise>
+ </xsl:choose>
}
</xsl:for-each>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic