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

List:       kde-commits
Subject:    KDE/kdebase/runtime/nepomuk/strigibackend
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2009-12-23 22:20:30
Message-ID: 1261606830.667117.24410.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1065638 by trueg:

Always clear the resource manager cache before getting the new resource URI.
Generate a new URI in case Resource::resourceUri did return an empty one.


 M  +9 -1      nepomukindexwriter.cpp  


--- trunk/KDE/kdebase/runtime/nepomuk/strigibackend/nepomukindexwriter.cpp #1065637:1065638
@@ -365,9 +365,17 @@
     // However, when updating data from pre-KDE 4.4 times we want to get rid of old file:/ resource
     // URIs. However, we can only do that if we were the only ones to write info about that file
     // Thus, we need to use Nepomuk::Resource again
-    if ( data->resourceUri.scheme() == QLatin1String( "file" ) )
+    if ( data->resourceUri.scheme() == QLatin1String( "file" ) ) {
+        // we need to clear the ResourceManager cache. Otherwise the bug/shortcoming in libnepomuk will
+        // always get us back to the cached file:/ URI
+        Nepomuk::ResourceManager::instance()->clearCache();
         data->resourceUri = Nepomuk::Resource( data->fileUrl ).resourceUri();
+    }
 
+    // create a new resource URI for non-existing file resources
+    if ( data->resourceUri.isEmpty() )
+        data->resourceUri = Nepomuk::ResourceManager::instance()->generateUniqueUri( QString() );
+
     // store initial data to make sure newly created URIs are reused directly by libnepomuk
     data->storeBasicData( d->repository );
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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