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

List:       kde-commits
Subject:    Re: [plasma-mediacenter] plugins: Add a basic Filesystem media source which is supposed to be very s
From:       Vishesh Handa <vhanda () kde ! org>
Date:       2014-04-01 9:24:38
Message-ID: 2849749.otrACZsfuj () vlap
[Download RAW message or body]

On Monday, March 31, 2014 11:56:31 PM Shantanu Tushar Jha wrote:
> > +
> > +bool FilesystemSearchMediaSource::checkAndAddFile(const QFileInfo&
> > fileInfo) +{
> > +    const QString mimeType = KMimeType::findByUrl(
> > +        KUrl::fromLocalFile(fileInfo.absoluteFilePath()))->name();
> > +
> 
> Warning: This will cause very high io usage since it is looking into the
> file to determine the mimetype. And considering that you're doing this for
> every file in $HOME ...
> 
> Yeah, I initially used KMimeType::findByPath exactly because of this but it
> always returned application/octet-stream for mp3 files. Ever happened to
> you?

Yup. Totally depends on the file name. If it ends with .mp3, then it will be 
detected correctly, otherwise it ends up being an octet stream.

> 
> Also, just to make things clear, this plugin is just for those few people
> who's want to try PMC on a non-KDE installation (as few such users asked
> for it). Might even write a plugin for Tracker et al (if that is still the
> stuff used on other DEs).

http://commits.kde.org/baloo/a7377e0cca4f63ca4ce56bef87ac1f82dd219970

:D

You may want to go the traditional route and add a list of folders where 
content should be looked for. Searching the entire $HOME is expensive AND it 
does not cover media mounted somewhere else. Eg - external media.

-- 
Vishesh Handa
[prev in list] [next in list] [prev in thread] [next in thread] 

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