Skanlite (was Glimpse) and libksane

Aaron J. Seigo aseigo at kde.org
Tue Apr 8 09:58:02 BST 2008


On Tuesday 08 April 2008, Kåre Särs wrote:
> On Friday 04 April 2008, Aaron J. Seigo wrote:
> > > > * what is the ">>>> 20 Shut of lamp <<<<" thing on the Other Options
> > > > tab?
> > >
> > > You have found a sane option that libksane can't handle :)
> >
> > ah, ok .. curious: how does one go about making libksane handle it? =)
> > e.g. which class(es) would i look into first?
>
> I guess this option could be a handler for a button on the scanner and at
> the moment there is no handling for those.
> Every option/parameter is a SaneOption object, so I guess sane_option.cpp
> is a good start.

ok.. btw, code like this:

    if (frame != 0) delete(frame);

is needless. deleting a null ptr is just fine. so you can just do:

    delete frame;

> > that's fine: use a QGridLayout insert all the labels in column 0 with
> > alignment Qt::AlignRight; for all the widgets to the right of the labels,
> > make sure each row of them is in their own hboxlayout (with 0 margins)
> > and insert that layout into column 1. voila.
>
> Every visible option has it's own frame with a grid layout. I have built an

i think that's not the best way to go about it... since this code is internal 
to the library and doesn't to be amazingly elegant ;) what i'd probably do is 
alter SaneOption by splitting frame() into QWidget *label() and QWidget 
*controls().

then in SaneWidget right after a createWidget call, i'd do something like:

if (option->label()) {
    if (!option->controls()) {
        // with a control, we assume this to be informational?
        layout->addWidget(currentRow, 0, 1, 0, option->label());
    } else {
        layout->addWidget(currentRow, 0, option->label(), Qt::AlignRight);
    }
}

if (option->controls()) {
   layout->addWidget(currentRow, 1, option->controls());
}

++currentRow;

but that's just me =)

> Would libksane need to be moved from extragear to kdereview for a review
> cycle before a move to kdegraphics?

no ... has there been a final conclusion between you and the kooka dev?

> I have not seen/noticed objections to moving Skanlite to
> extragear/graphics/. Is it OK to move it later this week?

+1 from me.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080408/873f9b25/attachment.sig>


More information about the kde-core-devel mailing list