[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/nepomuk/core
From: Vishesh Handa <handa.vish () gmail ! com>
Date: 2010-08-24 19:27:30
Message-ID: 20100824192730.28FA7AC857 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1167491 by vhanda:
Use Nepomuk::Varaint::toNodeList() in ResourceData::setProperty(..)
M +1 -28 resourcedata.cpp
M +2 -0 variant.cpp
--- trunk/KDE/kdelibs/nepomuk/core/resourcedata.cpp #1167490:1167491
@@ -424,8 +424,6 @@
// step 0: make sure this resource is in the store
QMutexLocker lock(&m_modificationMutex);
- QList<Node> valueNodes;
-
// make sure resource values are in the store
if ( value.simpleType() == qMetaTypeId<Resource>() ) {
QList<Resource> l = value.toResourceList();
@@ -434,36 +432,11 @@
}
}
- // add the actual property statements
-
- // one-to-one Resource
- if( value.isResource() ) {
- valueNodes.append( value.toUrl() );
- }
-
- // one-to-many Resource
- else if( value.isResourceList() ) {
- const QList<QUrl>& l = value.toUrlList();
- for( QList<QUrl>::const_iterator resIt = l.constBegin(); resIt != l.constEnd(); ++resIt ) {
- valueNodes.append( *resIt );
- }
- }
-
- // one-to-many literals
- else if( value.isList() ) {
- valueNodes = Nepomuk::valuesToRDFNodes( value );
- }
-
- // one-to-one literal
- else {
- valueNodes.append( Nepomuk::valueToRDFNode( value ) );
- }
-
// update the cache for now
m_cache[uri] = value;
// update the store
- MAINMODEL->updateProperty( m_uri, uri, valueNodes );
+ MAINMODEL->updateProperty( m_uri, uri, value.toNodeList() );
// update the kickofflists
updateKickOffLists( uri, value.toUrl() );
--- trunk/KDE/kdelibs/nepomuk/core/variant.cpp #1167490:1167491
@@ -1297,6 +1297,8 @@
else {
valueNodes.append( Nepomuk::valueToRDFNode( *this ) );
}
+
+ return valueNodes;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic