Index: kioslaves/tags/kio_tags.cpp =================================================================== --- kioslaves/tags/kio_tags.cpp (revision 879838) +++ kioslaves/tags/kio_tags.cpp (revision 879839) @@ -31,6 +31,7 @@ #include <QtCore/QEventLoop> #include <Soprano/Vocabulary/Xesam> +#include <Soprano/Vocabulary/NAO> using namespace KIO; @@ -41,16 +42,15 @@ // create a virtual folder stat thingi KIO::UDSEntry uds; uds.insert( KIO::UDSEntry::UDS_NAME, tag.genericLabel() ); - uds.insert( KIO::UDSEntry::UDS_TARGET_URL, tag.resourceUri().toString() ); - - // FIXME: add this once we have the data - // uds.insert( KIO::UDS_CREATION_TIME, date ); - + uds.insert( KIO::UDSEntry::UDS_DISPLAY_NAME, i18n( "Things tagged with '%1'", uds.stringValue( KIO::UDSEntry::UDS_NAME ) ) ); + uds.insert( KIO::UDSEntry::UDS_CREATION_TIME, tag.property( Soprano::Vocabulary::NAO::created() ).toDateTime().toTime_t() ); uds.insert( KIO::UDSEntry::UDS_ACCESS, 0700 ); uds.insert( KIO::UDSEntry::UDS_USER, KUser().loginName() ); uds.insert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR ); uds.insert( KIO::UDSEntry::UDS_MIME_TYPE, QString::fromLatin1( "inode/directory" ) ); - + QString icon = tag.genericIcon(); + if ( !icon.isEmpty() ) + uds.insert( KIO::UDSEntry::UDS_ICON_NAME, icon ); return uds; } } @@ -61,6 +61,7 @@ : KIO::ForwardingSlaveBase( "tags", poolSocket, appSocket ) { kDebug(); + // FIXME: connect to main model and listen for changes } @@ -74,6 +75,9 @@ { kDebug(); + // FIXME: always list all tags except the ones already in the path. These tags (subfolders) + // then allow to browse "Things tagged with 'A', 'B', and 'C'" and such + QString path = url.path(); if ( path.isEmpty() || path == "/" ) { listTags(); @@ -330,7 +334,6 @@ } -// we only list files here ATM void Nepomuk::TagsProtocol::listTag( const QString& tag ) { kDebug() << ": " << tag; @@ -339,10 +342,11 @@ Tag theTag( tag ); QList<Resource> taggedOnes = theTag.tagOf(); + // FIXME: use the search io slave code for resource listing + // FIXME: why can't we just use ForwardingSlaveBase to list result files? Probably the same reason as in the search io slave? for ( QList<Resource>::const_iterator it = taggedOnes.constBegin(); it != taggedOnes.constEnd(); ++it ) { const Resource& res = *it; - // FIXME: use the File class if ( res.hasProperty( Soprano::Vocabulary::Xesam::url().toString() ) ) { listEntry( statFile( KUrl( res.property( Soprano::Vocabulary::Xesam::url().toString() ).toStringList().first() ) ), false ); } @@ -358,7 +362,7 @@ m_currentUrl = url; m_currentUDS.clear(); - KIO::StatJob* job = KIO::stat( m_currentUrl, false ); + KIO::StatJob* job = KIO::stat( m_currentUrl, KIO::HideProgressInfo ); connect( job, SIGNAL( result(KJob *) ), this, SLOT( slotResult(KJob *) ) ); connect( job, SIGNAL( redirection(KIO::Job *, const KUrl &) ),