[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs/nepomuk/core
From:       Vishesh Handa <handa.vish () gmail ! com>
Date:       2010-08-26 17:46:59
Message-ID: AANLkTimXm_PDZUVGk1SACfEn-r8f2qPpKZhEBiQgD76W () mail ! gmail ! com
[Download RAW message or body]

Thanks!

On Thu, Aug 26, 2010 at 10:40 PM, Sebastian Trueg <sebastian@trueg.de>wrote:

> SVN commit 1168448 by trueg:
>
> Fixed handling of invalid nodes in toNode and toNodeList
>
>  M  +3 -4      variant.cpp
>
>
> --- trunk/KDE/kdelibs/nepomuk/core/variant.cpp #1168447:1168448
> @@ -1255,10 +1255,9 @@
>
>  Soprano::Node Nepomuk::Variant::toNode() const
>  {
> -    if( isList() )
> +    if( !isValid() || isList() )
>         return Soprano::Node();
> -
> -    if( isResource() )
> +    else if( isResource() )
>         return Soprano::Node( toUrl() );
>     else
>         return Soprano::Node( Soprano::LiteralValue( variant() ) );
> @@ -1281,7 +1280,7 @@
>             nl.append( Soprano::Node( Soprano::LiteralValue::fromString(
> *it, ( QVariant::Type )simpleType() ) ) );
>         }
>     }
> -    else {
> +    else if( isValid() ) {
>         nl.append( toNode() );
>     }
>
>

[Attachment #3 (text/html)]

Thanks!<br><br><div class="gmail_quote">On Thu, Aug 26, 2010 at 10:40 PM, Sebastian \
Trueg <span dir="ltr">&lt;<a \
href="mailto:sebastian@trueg.de">sebastian@trueg.de</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"> SVN commit 1168448 by trueg:<br>
<br>
Fixed handling of invalid nodes in toNode and toNodeList<br>
<br>
 M  +3 -4      variant.cpp<br>
<br>
<br>
--- trunk/KDE/kdelibs/nepomuk/core/variant.cpp #1168447:1168448<br>
@@ -1255,10 +1255,9 @@<br>
<br>
 Soprano::Node Nepomuk::Variant::toNode() const<br>
 {<br>
-    if( isList() )<br>
+    if( !isValid() || isList() )<br>
         return Soprano::Node();<br>
-<br>
-    if( isResource() )<br>
+    else if( isResource() )<br>
         return Soprano::Node( toUrl() );<br>
     else<br>
         return Soprano::Node( Soprano::LiteralValue( variant() ) );<br>
@@ -1281,7 +1280,7 @@<br>
             nl.append( Soprano::Node( Soprano::LiteralValue::fromString( *it, ( \
QVariant::Type )simpleType() ) ) );<br>  }<br>
     }<br>
-    else {<br>
+    else if( isValid() ) {<br>
         nl.append( toNode() );<br>
     }<br>
<br>
</blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic