KDE_FULL_SESSION and version detection
Lubos Lunak
l.lunak at suse.cz
Sun Feb 4 20:16:42 GMT 2007
On Sunday 04 February 2007 20:41, Kevin Krammer wrote:
> On Sunday 04 February 2007 20:14, Lubos Lunak wrote:
> > On Sunday 04 February 2007 17:48, Aaron J. Seigo wrote:
> > > hi all...
> > >
> > > we need a way to differentiate a KDE4 session from a KDE3 session at
> > > runtime. this is useful for, for instance, xdg-utils scripts.
> > >
> > > a thought that occurred to me is including a version string in
> > > KDE_FULL_SESSION rather that just setting it to 'true'. simply looking
> > > for kde4-config may not be (well, is not) sufficient. thoughts?
> >
> > There's bound to be somebody[*] silly enough to
> > write 'test "$KDE_FULL_SESSION" = "true"' instead of
> > simply 'test -n "$KDE_FULL_SESSION"', so the question is whether we care.
>
> Since sombody[*] is me, wouldn't the proposed check test for non-zero
> length content of the variable instead of "true" as documented on
> http://wiki.kde.org/tiki-?page=Environment+Variables
That's the intention, it's set to something when full session is running,
it's not set to something when not. Search me why contents of boolean envvars
should matter.
> If the value is not intended to be checked, wouldn't it be better to write
> something like "will be set to some random junk at KDE startup"?
It is set to some random junk, namely "true" :). I don't know who wrote that
page, $KDE_FULL_SESSION used to be internal for quite some time. Now it's
probably too late anyway.
> > Also, doing this would mean asserting that we don't care about even
> > basic KDE3 vs KDE4 backwards compatibility.
>
> I am afraid there is a collision about having the same executable name for
> KDE3 tools and KDE4 tools and the option of installing into the same
> prefix.
I think that would be solvable if somebody wanted to do that.
--
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12 tel: +420 284 028 972
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http//www.suse.cz
More information about the kde-core-devel
mailing list