[Kde-graphics-devel] Using libksane from a non-graphical application

Ben Martin monkeyiq at users.sourceforge.net
Tue Apr 26 12:26:25 CEST 2011


Hi,
  I decided to allow libferris to mount scanners at long last. The
basics of this exposure is to configure sane and grab an image to jpg or
png. The code in skanlite does very similar things, but as a filesystem
I don't create any graphical interface. 

  It turns out that things work well from the console, though the calls
to KMessageBox::sorry() in KSaneWidgetPrivate::oneFinalScanDone() are
quite deadly as the dialog is not shown and the whole thing seems to
hang there. A visit to gdb shows that the dialog is up and not shown in
the backtrace.

  Inside imageReady() I call scanCancel() to try to avoid these
KMessageBoxes but it seems I get two scanDone() signals anyway and the
second one complains that the ADF is out of ammo and thus the
KMessageBox is attempted by libksane.

  About the only other thing I see that would be handy is a 
QList< QString > getDeviceNames() const;
sort of method to enumerate the scanners. This assumes that there is any
interest in allowing non graphical clients to pick at libksane. Other
than that libksane allows fairly straightforward scanning from the
console. :)

(oh, I'm not on list, please CC relies if any).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://mail.kde.org/pipermail/kde-graphics-devel/attachments/20110426/99ad61e3/attachment.sig 


More information about the Kde-graphics-devel mailing list