trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: March 2011

Re: [trinity-devel] $KDEHOME

From: Darrell Anderson <humanreadable@...>
Date: Wed, 16 Mar 2011 12:41:33 -0700 (PDT)
I filed bug report 459 against the problem of the Trinity default $KDEHOME location trashing a user's KDE4 profile. I think I have a solution and I'll submit patches, but first here is the basic idea that I ask others to consider and approve/disapprove.

1. To avoid potential conflicts with KDE3 and KDE4 users, $HOME/.trinity will become the Trinity default for $KDEHOME. Many people might have KDE4 and Trinity installed, but I envision people such as developers, packagers, and testers having KDE3 installed too. Possibly then there would be three profile directories. So let's avoid any conflict at all.

2. kstandardirs.h, kstandardirs.cpp, and startkde would be updated to be consistent to $HOME/.trinity. Are there any other locations in the source code that need the same attention? I don't know.

3. As $KDEHOME would then always default to $HOME/.trinity when using Trinity, some quiet automated migration code will be added to startkde. That snippet would run only once. Basically something like this:

$KDEHOME=$HOME/.trinity
# If $HOME/.trinity exists then skip this one-time migration section.
if [ ! -d $HOME/.trinity ]; then
  # If $HOME/.kde3 exists, probably safe to presume that is from KDE3. Go ahead and migrate that profile.
  if [ -d $HOME/.kde3 ]; then
    cp -a $HOME/.kde3 $HOME/.trinity
  elif [ -d $HOME/.kde ]; then
    # This is tricky --- ensure this profile directory is NOT KDE4.
    if [ ! -f $HOME/.kde/share/config/nepomukstrigirc ] && [ ! -f $HOME/.kde/share/config/plasmarc ] && [ ! -f $HOME/.kde/share/config/krunnerrc ]; then
      # That was three different tests. Probably not a KDE4 profile. Go ahead and migrate that profile.
      cp -a $HOME/.kde $HOME/.trinity
    fi
  fi
fi

I am not a KDE4 guru. If you can think of more robust tests then please let me know.

Darrell


--- On Tue, 3/15/11, Darrell Anderson <humanreadable@...> wrote:

> From: Darrell Anderson <humanreadable@...>
> Subject: Re: [trinity-devel] $KDEHOME
> To: trinity-devel@...
> Date: Tuesday, March 15, 2011, 6:19 PM
> Yes, startkde tries to check this
> variable. If not already explictly set, startkde presumes to
> set the variable to $HOME/.kde.
> 
> That will trash the user's KDE4 profile even if the OS does
> not explictly define $KDEHOME because $HOME/.kde is the
> default profile location for KDE4.
> 
> Further, the default in startkde conflicts with
> kdelibs/kdecore/kstandardirs.cpp.
> 
> Bug report 459 filed.
> 
> Darrell
> 
> 
> --- On Tue, 3/15/11, Timothy Pearson <kb9vqf@...>
> wrote:
> 
> > From: Timothy Pearson <kb9vqf@...>
> > Subject: Re: [trinity-devel] $KDEHOME
> > To: trinity-devel@...
> > Date: Tuesday, March 15, 2011, 5:55 PM
> > > On Tue, Mar 15, 2011 at 4:34 PM,
> > Darrell Anderson
> > > <humanreadable@...>
> > wrote:
> > >> I don't read c++ very well. Seems to me that
> if
> > $KDEHOME is not
> > >> explicitly defined then Trinity defaults to
> > $HOME/.kde3. Yet the
> > >> comments in kstandardirs.h declare $HOME/.kde
> as
> > the default.
> > >>
> > <snip>
> > 
> > The startkde script primarily determines $KDEHOME
> > IIRC.  If there is a
> > secondary default in the code, then it should be set
> to
> > $HOME/.trinity. 
> > If this is not the case, then a bug report should be
> > filed.
> > 
> > Tim
> > 
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: trinity-devel-unsubscribe@...
> > For additional commands, e-mail: trinity-devel-help@...
> > Read list messsages on the Web archive: http://trinity-devel.pearsoncomputing.net/
> > Please remember not to top-post: http://trinity.pearsoncomputing.net/mailing_lists/#top-posting
> > 
> > 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: trinity-devel-unsubscribe@...
> For additional commands, e-mail: trinity-devel-help@...
> Read list messsages on the Web archive: http://trinity-devel.pearsoncomputing.net/
> Please remember not to top-post: http://trinity.pearsoncomputing.net/mailing_lists/#top-posting
> 
>