[sane-devel] XSane (and maybe other frontends) backend name detection problem

Henning Meier-Geinitz henning@meier-geinitz.de
Sat, 16 Nov 2002 14:26:03 +0100


Hi,

While playing with the localized backend options I noticed that xsane
sometimes doesn't use the German ones, even if LANG=de_DE is set.
XSane itsself uses German language, only the backend options aren't
translated.

I found out that this problem occurs when I use libusb devices. XSane
needs the backend name for getting the correct mo files
(sane-backendname.mo) and this backend name is "001" if I use libusb.

Examples: "mustek_usb:/dev/scanner" --> "mustek_usb"
          "mustek_usb:libusb:001:002" --> "001"
	  
So XSane get's the backend name from the string before the last ":".
Is there a better way to get the backend name? Just using the first
part won't work, if e.g. the net backend is used. Any other ideas?

We could change the delimiter used for libusb devices, if there is no
other way. However, the idea was to use a delimiter that can't be used
in the filesystem (or is at least unlikely to cause any clashes). As
":" is used as path delimter in e.g. $PATH, I used this character.

Anye ideas?

Bye,
  Henning