[Nepomuk] Nepomuk KIO Slave limitations
Alessandro Diaferia
alediaferia at gmail.com
Tue Jun 8 11:04:41 CEST 2010
2010/6/8 Alessandro Sivieri <alessandro.sivieri at gmail.com>
> 2010/6/7 Alessandro Diaferia <alediaferia at gmail.com>
>
> As you may have understood i'm using Nepomuk to show media files to the
>> user.
>> One thing i noticed is that when using the KDirModel (and so the
>> KDirLister) to list the results of a query
>> it seems that each QModelIndex doesn't have a valid
>> KDirModel::FileItemRole and therefore no important pieces of information
>> like the url of the file (AFAIK KDirModel is KFileItem-centric). I make
>> use of such role in order to get previews of the files.
>>
>>
> Well, both in Sembrowser and in Smartsave I am using KDirOperator, and it
> works correctly for me, I mean files are shown with correct name and icon,
> and they are correctly opened once passed to KRun; I use
> Nepomuk::Query::toSearchUrl, to obtain the URL to set the URL to
> KDirOperator.
> I think I also used KDirModel directly some time ago, but then I decided
> that the operator was better.
> Can you show us some code?
>
Ok, giving some context: the mediabrowser applet we use in PMC takes
advantage of an AbstractItemView written from scratch (aka not inheriting
from QAbstractItemView).
This means that the QAbstractItemModel passed is handled internally. If the
set model makes use of KDirModel::FileItemRole additional capabilities are
enabled:
this means that not only the name and the icon is drawn but now, through the
given KFileItem, the view has access to the URL of the file and can, for
example, retrieve previews.
Unfortunately I cannot make use of KDirOperator as long as PMC has this
particular structure. My concern now is: is there a way to get the file url
for the particular nepomuk search result?
I might go for Nepomuk::Resource::property(Vocabulary::NIE::url()) i don't
know how to build the resource from the given QModelIndex.
Hints appreciated :p
>
> --
> Sivieri Alessandro
> alessandro.sivieri at gmail.com
> http://www.chimera-bellerofonte.eu/
> http://www.poul.org/
>
Thank you.
P.S.: forgot to mention that I'm using Nepomuk::Query::toSearchUrl too,
passing it to the KDirLister->openUrl() method.
--
Alessandro Diaferia
KDE Developer
KDE e.V. member
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20100608/03cafe47/attachment.htm
More information about the Nepomuk
mailing list