From kde-core-devel Tue Mar 27 18:38:46 2001 From: aleXXX Date: Tue, 27 Mar 2001 18:38:46 +0000 To: kde-core-devel Subject: Re: Part loading where mimetype won't work and KIO filters. X-MARC-Message: https://marc.info/?l=kde-core-devel&m=98571832622907 On Tuesday 27 March 2001 16:19, Rik Hemsley wrote: > 1. > > I'd like to have a KPart loaded when audiocd:/ is requested. I can't > do this based on mimetype because audiocd:/ has a type of 'directory'. > > Is there a way to load a part based on URL ? > > The other tricky part is that the part must not be loaded if a filename > is specified, e.g. audiocd:/track01.wav This was on kde-devel, it's probably also the solution to your problem, so try to do it :-) On Tuesday 27 March 2001 18:10, David Faure wrote: > On Tuesday 27 March 2001 17:14, aleXXX wrote: > > On Tuesday 27 March 2001 17:18, David Faure wrote: > > > On Tuesday 27 March 2001 16:44, aleXXX wrote: > > > > How about different mimetypes for different kind of directories ? > > > > E.g. a special mimetype for a directory containing mp3's, this one > > > > could then be displayed with a special mp3 dir view, and so on. It > > > > could be specified either by the reporting ioslave or by a .directory > > > > file in the parent dir. Did I ever mention that a special mimetype > > > > for hosts would be cool ? ;-) .... > > > That's another good thing about testing for S_IFDIR to know if > > > something is a directory. The mimetype name itself can be anything > > > (thus changing the icon accordingly etc.). You'll have to check that > > > there isn't any test for inode/directory anymore though, there may > > > still be a few around. > > > > And as usually, can you give me some more hints how to do it ? > > Or is there actually not much to do ? > > Where can the tests be (konqy, libkio,...) ? > > Don't know... let's grep :) > > ./kservicetype.cpp: if ( _servicetype != "inode/directory" && > _servicetype != "inode/directory-locked" ) Ah, this means that e.g. > inode/host will be part of "all/allfiles" instead of "all/alldirs". A very > small problem since those aren't much used afaik, but still - more on this > below. > > The other matches I found in kio were irrelevant (tests only > for local files, or for unknown-yet mimetypes, etc.) > > Now grepping in konqueror... > One problem is associating the konq views with those > mimetypes, so that they can open them. > > Ah, maybe inode/host could _inherit_ inode/directory ? > That would solve the problem very nicely. > Inheritance in servicetypes already exists (I added that some time ago), > and mimetypes are simply particular service types. > That would be the nicest way to go. Try with > X-KDE-Derived=inode/directory in the mimetype file for inode/host. > Then the above test can be changed to use inheritance instead, > and the tests in Konqueror too. Bye Alex