On Mon, Feb 26, 2001 at 10:06:00PM -0800, Waldo Bastian wrote: > On Monday 26 February 2001 18:51, David Faure wrote: > > On Tuesday 27 February 2001 02:31, Michael Olbrich wrote: > > > Hello! > > > > > > In my application I use 'locate("appdata",...)' to access some recources. > > > Now I started to make a KPart of my program, and of course locate doesn't > > > work any more. > > > Where does locate search now, or what's the best way to solve this > > > problem? > > > > You have to use your part's instance, this way for "instance" (no pun > > intended) : > > > > instance()->dirs()->findResource( type, filename ) > > or > > locate( type, filename, instance() ); > > > > appdata may be an additional problem though (it's related to > > the application)... Better use locate( "data", mypart+'/'+.... ) > > where mypart is the instance name. > > (see kdelibs/kparts/tests/example.cpp for instance) > > > > Basically, use the part's instance as much as possible, for everything > > relating to the part (directories, config files, resources etc.) > > Can't we make a KPart register "partdata"? Then the answer would become "use > the instance of the part, and replace 'appdata' with 'partdata'" Sounds like a very good idea to me :-) Bye, Simon