[gobolinux-users] KDE: Create new.... symlink???

Hisham Muhammad hisham.hm at gmail.com
Mon Sep 10 06:08:02 UTC 2007


On 9/10/07, Jonas Karlsson <jonka750 at student.liu.se> wrote:
> On Mon, 10 Sep 2007 06:29:39 +0200, Michael Homer <gobo-users-dufus at wotfun.com> wrote:
>
> > On 9/8/07, Michael Dickson <mike at communicatezing.com> wrote:
> >> On Friday 07 September 2007 3:48:43 am Jonas Karlsson wrote:
> >> > 2007/9/7, kenneth marken <k-marken at online.no>:
> >> > > On Friday 07 September 2007 08:35:55 Michael Homer wrote:
> >> > > > On 9/7/07, Andy Feldman <nereusren at gmail.com> wrote:
> >> > > > > On Thursday 06 September 2007 18:43, Michael Homer wrote:
> >> > > > > > On 9/7/07, Michael Dickson <mike at communicatezing.com> wrote:
> >> > > > > > > I just noticed that when I right-click on the Desktop and choose
> >> > > > > > > Create New -> "..."
> >> > > > > > > the resulting file is a symlink, not the real file!
> >> > > > > >
> >> > > > > > What's the "..." here? Where does the symlink point? I can't
> >> > > > > > duplicate this here.
> >> > > > >
> >> > > > > I get the same thing. If I right-click in Konqueror file browser and
> >> > > > > choose "Create New" > "Text File...", it creates a symlink
> >> > > > > to /Programs/KDE-Base/3.5.3/Shared/templates/.source/TextFile.txt.
> >> > > > > Similarly with all the other file types that appear in that section
> >> > > > > of the "Create New" submenu. It's not restricted to the entries from
> >> > > > > KDE-Base: Creating a new office text document makes a link
> >> > > > > to /Programs/KOffice/1.6.1/Shared/templates/.source/TextDocument.kwt.
> >> > > >
> >> > > > It doesn't for me for any of them (ls -l confirms it), and so far as I
> >> > > > can tell I have basically the same setup as the original poster,
> >> > > > although there are a couple of KDE components that are still at 3.5.6
> >> > > > (-Network is one, I don't remember the other). So I can't explain
> >> > > > what's going on for everybody else...
> >> > >
> >> > > wild guess, when kde does a "create new" what it does its copy a existing
> >> > > file into place under a new name. or atleast thats how it looks. so can
> >> > > it be that it ends up copying the symbolic links  that gobo use rather
> >> > > then the files in question?
> >> > >
> >> > > hmm, only thing i know i have done is to recompile kde-base so as to get
> >> > > smb support. outside of that im using binary packages as much as
> >> > > possible.
> >> >
> >> > I think the difference in setup is that those that get the symlink has
> >> > other templates installed, which would make SymlinkProgram expand
> >> > every directory and make the files links, instead of how Michael (and
> >> > I) have it where the link is /System/Links/Shared/templates ->
> >> > /Programs/KDE-Base/3.5.6/Shared/templates and
> >> > /System/Links/Shared/templates/.source/foo is a real document.
> >> >
> >> > Konqueror should read the link, so this should be reported as a bug
> >> > upstream.
> >>
> >> Nice catch Jonas.  That does work.  Of course, this prevents any KOffice items
> >> from showing up...
> >>
> >> Natually, using hard links to the individual files (with the exception of
> >> emptydir) in .source works fine.
> >>
> >> I've opened KDE Bug #149628 on this issue, referencing this thread.
> > I have attached a patch to this bug that seems to fix the problem,
> > hopefully it will be applied. I have attached one suitable for
> > dropping in the Recipe directory for KDE-Base to this message. Give it
> > a try. If it works for everybody else I'll check in a new revision
> > tomorrow.
>
> Great! I was looking at doing a patch almost exactly like this. However
> I would have put the readlink code addition a bit higher up, in the
> parseFile function just when the file is recognized as an old-style
> template. After, or maybe replacing some of the code:
>
>                      // No dest, this is an old-style template
>                      (*templ).entryType = TEMPLATE;
>                      (*templ).templatePath = (*templ).filePath; // we'll copy the file
>
> to resolve the link when or before the path is copied. I think that when the
> readlink code is where you have placed it you will apply it to unnecessary
> files, but I really don't know. I haven't done any patches for KDE before
> either. :)

In any case thanks for the patch! I was wrapping my head thinking of
ways to fix this as it exposes a fundamental limitation of our way of
working, but the patch made me realize that, having hit this
limitation only now after so many years, this means it's enough of a
corner case that warrants being handled in a per-app basis.

-- Hisham


More information about the gobolinux-users mailing list