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

List:       kde-devel
Subject:    Re: localkdedir, kde_appsdir() obsolete...
From:       iglio () fub ! it (Pietro Iglio)
Date:       1999-07-05 9:01:39
[Download RAW message or body]

At 17.28 02/07/99 +0200, you wrote:
>Pietro Iglio wrote:
>> 
>> At 16.24 02/07/99 +0200, you wrote:
>> >Pietro Iglio wrote:
>> >>
>> >> When I start kpanel I get several messages like:
>> >>
>> >> localkdedir is obsolete. Try to use KStandardDirs instead
>> >> kde_appsdir() is obsolete. Try to use KStandardDirs instead
>> >>
>> >> I want to replace these obsolete function. How to use
>> >> KStandardDirs to access local/global directories?
>> >> For example,
>> >>
>> >> KStandardDirs::getResourceDirs("apps")
>> >>
>> >> returns a QStringList type {"/opt/kde/share/applnk",
>> "~/.kde/share/applnk"}.
>> >> How can I select between local/global directories?
>> >
>> >What do you want to do? Why do you need the difference
>> >between local and global directories?
>> >
>> >E.g. "normal" applications use locate() to find a resource
>> >(either global or local), and use locateLocal() to find a
>> >place where they can write it to (local).
>> >
>> >But somehow I think that kpanel wants do something more
>> >so for that you need to tell _what_ you want to do.
>> 
>> KPanel needs to parse the global and the local applnk directories
>> to build the global and the personal menus.
>> Thus it needs a way to get the /opt/kde/share/applnk path and
>> another way to get the ~/.kde/share/applnk.
>
>Hm. Well.. You can get findAllResources() (Something like that)
>to get all applinks (local + global). Then you might still need
>a way to find out if an entry is local or global.
>
>Please be aware that in KDE2.0 a user can have multiple levels
>of globalness e.g global / group / local. 
>
>If you lookup all entries with "findAllResources" you could
>do a locateLocal("applink", "") (or whatever name is used to 
>identify "share/applnk", see kstddirs.cpp) which should return
>~/.kde/share/applnk". You could then do a match to see which
>entry belongs where. 
>
>Might not be the best solution though...

Isn't much easier to add a method to get the global/group/local 
directory for a given type? Eg:

KStandardDirs::getResourceDirs("apps", KStandardDirs::global)
    (-> $KDEDIR/share/applnk)
KStandardDirs::getResourceDirs("apps", KStandardDirs::group)
    (-> ????/share/applnk)
KStandardDirs::getResourceDirs("apps", KStandardDirs::user)
    (-> .kde/share/applnk)

Probably you can do the same with the current interface, but the way
I suggest is probably much more readable. Alternatively, please could 
you translate the above statements using the current interface?

-- Pietro

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

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