=C2=A0 Original Message =C2=A0 From: Vishesh Handa Sent: Tuesday 1 April 2014 2:49 PM To: Shantanu Tushar Jha Cc: kde-commits@kde.org Subject: Re: [plasma-mediacenter] plugins: Add a basic Filesystem media sou= rce which is supposed to be very simple and only scan the home dir. On Monday, March 31, 2014 11:56:31 PM Shantanu Tushar Jha wrote: > > + > > +bool FilesystemSearchMediaSource::checkAndAddFile(const QFileInfo& > > fileInfo) +{ > > + const QString mimeType =3D KMimeType::findByUrl( > > + KUrl::fromLocalFile(fileInfo.absoluteFilePath()))->name(); > > + >=20 > 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 ... >=20 > 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 b= e=20 detected correctly, otherwise it ends up being an octet stream. >=20 > 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=20 content should be looked for. Searching the entire $HOME is expensive AND i= t=20 does not cover media mounted somewhere else. Eg - external media. Also, this is in the plan once we get a way to let the user configure stuff= . There are few things still need to be sorted out.=E2=80=8E --=20 Vishesh Handa