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

List:       kde-commits
Subject:    playground/base/nepomuk-kde/kioslaves/tags
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2008-01-22 12:45:38
Message-ID: 1201005938.335220.28655.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 764722 by trueg:

Fixed entering tagged directories. Persisting problem (as with all kio slaves): \
annotating the url will result in different resource URIs for the same files.

 M  +21 -3     kio_tags.cpp  


--- trunk/playground/base/nepomuk-kde/kioslaves/tags/kio_tags.cpp #764721:764722
@@ -281,6 +281,21 @@
     kDebug();
     QString tag, path;
     if ( splitUrl( url, tag, path, false ) ) {
+        if ( !tag.isEmpty() ) {
+            // HACK
+            // FIXME: This is no solution, especially because path is not unique!
+            Tag t( tag );
+            foreach( Resource res, t.tagOf() ) {
+                if ( res.hasProperty( Soprano::Vocabulary::Xesam::url().toString() ) \
) { +                    QString p = res.property( \
Soprano::Vocabulary::Xesam::url().toString() ).toString(); +                    if ( \
p.endsWith( path ) ) { +                        newURL = p;
+                        return true;
+                    }
+                }
+            }
+        }
+
         newURL = path;
         return true;
     }
@@ -296,8 +311,10 @@
     path = url.path().mid( 1 );
     int pos = path.indexOf( '/' );
     if ( pos > 0 ) {
-        tag = path.left( pos-1 );
+        tag = path.left( pos );
         path = path.mid( pos );
+        if ( path.endsWith( "/" ) )
+            path.truncate( path.length()-1 );
         return true;
     }
     else if ( !path.isEmpty() ) {
@@ -389,9 +406,10 @@
     else {
         KIO::StatJob* stat_job = qobject_cast<KIO::StatJob*>(job);
         if ( stat_job != 0 ) {
+            // FIXME: The name is not unique here! This is a problem especially for
+            // rewriteUrl since then the URL is also not unique
             KIO::UDSEntry uds = stat_job->statResult();
-            // FIXME: The line below makes KDirModel crash since different protocols \
                in one hierarchy are not allowed
-//            uds.insert( KIO::UDSEntry::UDS_URL, m_currentUrl.url() );
+            uds.insert( KIO::UDSEntry::UDS_LOCAL_PATH, m_currentUrl.path() );
             listEntry( uds, false );
         }
     }


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

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