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

List:       kde-devel
Subject:    Re: localkdedir, kde_appsdir() obsolete... (fwd)
From:       Stephan Kulow <coolo () max ! tat ! physik ! uni-tuebingen ! de>
Date:       1999-07-05 14:50:41
[Download RAW message or body]

Another mail that didn't arrive :(


---------- Forwarded message ----------
Date: Mon, 05 Jul 1999 14:27:31 +0200
From: Stephan Kulow <coolo@kde.org>
To: KDE Developer <kde-devel@kde.org>
Subject: Re: localkdedir, kde_appsdir() obsolete...

Pietro Iglio wrote:
> 
> 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?
> 
Actually the new interface removes these assumptions that there are 
actual dirs for everything completly. Why do you want to differ
between local and global at all? I can't see a reason for it.
What I would expect as user is that when I place a file in $HOME/.kde
it overwrites the file from $KDEDIR. 

So just rewrite kpanel to not have a personal menu, but have one menu
with every applnk in it. For this you can use findAllResources. If you
need to save changes the user does (the user should be able to edit
every entry in the menu), it saves to locateLocal and next time
findAllResources
runs, you'll find two entries and when you ignore the later, you'll have
what
the user expected to happen when he changed the entry (it changed).

Greetings, Stephan

-- 
As long as Linux remains a religion of freeware fanatics,
Microsoft have nothing to worry about.  
                       By Michael Surkan, PC Week Online

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

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