[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: preset bookmarks

Achim Bohnet wrote:
> Hi Ivan,
> $kdehome/share/apps/kfm/bookmark/  tree was the old bookmark stuff with
> *.desktop and/or *.kdelnk (?).  If bookmarks.xml does not exist a new one
> is generated from them.  So if you copy a default
> bookmarks.xml file and someone that used KDE < 2.1 and start KDE > 2.0 for the
> first time, he/she only sees 'your' bookmarks but not his/her old bookmarks.
> ...

Hey, this gives me a "smart" idea for doing this:

1. In /etc/kde2/share/apps/kfm/bookmark/default/ place
  old-format bookmarks as conffiles.

2. In the script that does the conversion from old format
  to new format (probably when that user first starts the
  new Konquerer version), or in some script executed
  before that, create a symlink from
.kde/share/apps/kfm/bookmark/default to

3. When Konquerer first starts for a user who has never used
  Konquerer, the conversion process will automagically
  include the default bookmarks based on the "belief" that
  they are old user bookmarks needing conversion.

4. When Konquerer first starts for a user who has used an
  older version of Konquerer, the same will happen.

5. When Konquerer is started by a user who has run a
  new-format Konquerer before, the new bookmarks are not
  included or updated).  Too bad really.

I have two other ideas:

Idea A:

In a seperate or non-kde package, include just the following
files (plus any cruft required by policy)
each file would contain the same recommended
Debian-related links independent of the users choice of
browser or Desktop. Maintainance could be transfered to
someone unrelated to KDE.

links.txt is the source file, the maintainer of each
browser provides a simple script for generating his
specific format from it.  Normally, these scripts would
be used only as a build-dependency for the debian-links
package, but they may be useful to people porting
bookmark links in general.

Example: For Netscape, the script might go like this
(not tested!)
# Awk script
BEGIN { print "Netscape standard beginning"; }
END { print "Netscape standard end" }
/^#/ { next }
/^[ \t]*$/ { next }
$1 == "dirup" { print "</DL><p>"; next }
{ title = substr($0, index(" ", $0) + 2); }
$1 == "dir" { print "<DT><H3>" title "</HT>\n<DL><p>"; next }
{print "<DT><A HREF=\"" $1 "\" ADDDATE=.... >" title "</A>" }

This presumes a links.txt like this
# comment line
# blank lines are ignored

# all fields are seperated by exactly one space to
#    facilitate use of standard text utilities
# all standard links go in Debian-Defaults
# directory names should be valid hostnames, just a-zA-Z0-9-
dir Debian-Defaults
http://www.debian.org Debian home page
http://www.linux.org Linux Online
# KDE is a subdir of Debian-Defaults
dir KDE
http://www.kde.net KDE home
http://www.tdyc.com Nice guys
# And so is GNOME
http://www.gnome.whatever/somedir Gnome home page
# end of file

To facilitate mechanical parsing, the file should be
restricted to a few specific tag types and specific
line feed placements, even though these restrictions
are not required by HTML.

Idea B:


Modify the bookmark loading code inside KDE to support
a file or directory of system-wide bookmarks, which is
always loaded along with the per-user bookmarks.  Then
provide a default such file as a conffile.  I am sure
a lot of other people could use the feature, not just
in Debian.

While you are at it, allow at least 3 system-wide files,
which are merged implicitly at load time.
One provided by KDE and maintained by KDE
One provided by the distribution and maintained by the
   distribution (in this case a symlink to
One provided by the sysadmin, which can survive upgrades
   to the standard links.  This could contain e.g.
   http://ourcampus.edu or http://internalserver.internal

Note that I am not proposing anything too complex,
If the structure is a file or directory per bookmark
folder, simply include 3 symlinks in the default
per user dir contents.  If the structure is a single
file an implicit in memory concatenation of 4 files
and an implicit splitting at save time should do nicely.

In either case, editing system-wide bookmarks is
implicitly persistent if and only if the user successfully
writes to the system-wide file (independent of how the file
system decides that: root or not root, file mode bits,
read-only mounts, ACLs, the code doesn't care it just
ignores save errors).

This message is hastily written, please ignore any unpleasant
do not consider it a binding commitment, even if its phrasing may
indicate so. Its contents may be deliberately or accidentally
Trademarks and other things belong to their owners, if any.

Reply to: