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

List:       kde-commits
Subject:    branches/KDE/4.3/kdelibs/nepomuk/core
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2009-08-05 13:10:53
Message-ID: 1249477853.815781.16739.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1007294 by trueg:

Backport: Handle Resource::resourceUri in toUrlList. This allows to convert QUrl, \
QList<QUrl>, Resource, and QList<Resource> into a QList<QUrl>


 M  +10 -2     variant.cpp  


--- branches/KDE/4.3/kdelibs/nepomuk/core/variant.cpp #1007293:1007294
@@ -1067,13 +1067,21 @@
 
 QList<QUrl> Nepomuk::Variant::toUrlList() const
 {
-    if( isUrl() ) {
+    if( isUrl() || isResource() ) {
         QList<QUrl> l;
         l.append( toUrl() );
         return l;
     }
-    else
+    else if( isResourceList() ) {
+        QList<QUrl> l;
+        QList<Resource> rl = toResourceList();
+        foreach(const Resource& r, rl)
+            l << r.resourceUri();
+        return l;
+    }
+    else {
         return d->value.value<QList<QUrl> >();
+    }
 }
 
 


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

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