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

List:       kde-commits
Subject:    KDE/kdelibs/nepomuk/core
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2010-08-26 17:10:00
Message-ID: 20100826171000.C4583AC857 () svn ! kde ! org
[Download RAW message or body]

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() );
     }
 


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

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