~ubuntu-branches/ubuntu/maverick/kdegraphics/maverick-proposed

« back to all changes in this revision

Viewing changes to libs/libksane/libksane/options/ksane_opt_fslider.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-12-02 14:03:43 UTC
  • mfrom: (1.1.35 upstream)
  • Revision ID: james.westby@ubuntu.com-20091202140343-2732gbkj69g89arq
Tags: 4:4.3.80-0ubuntu1
* New upstream beta release:
  - Add build-depend on shared-desktop-ontologies for nepomuk integration
  - Bump .so versions for libkexiv, libkdcraw and libkipi
  - Update various .install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
{
45
45
 
46
46
KSaneOptFSlider::KSaneOptFSlider(const SANE_Handle handle, const int index)
47
 
: KSaneOption(handle, index), m_slider(0), m_minChange(MIN_FIXED_STEP)
 
47
: KSaneOption(handle, index), m_slider(0), m_fVal(0), m_minChange(MIN_FIXED_STEP)
48
48
{
49
49
}
50
50
 
92
92
        m_slider->setStep(MIN_FIXED_STEP);
93
93
    }
94
94
    m_minChange = m_slider->step()/2;
95
 
    m_slider->setSuffix(unitString());
 
95
    m_slider->setSuffix(unitDoubleString());
96
96
    m_slider->setLabelText(i18n(m_optDesc->title));
97
97
}
98
98
 
126
126
    if (((val-m_fVal) >= m_minChange) || ((m_fVal-val) >= m_minChange)) {
127
127
        unsigned char data[4];
128
128
        SANE_Word fixed;
129
 
        //kDebug(51004) <<m_optDesc->name << fVal << "!=" << val;
 
129
        //kDebug() <<m_optDesc->name << fVal << "!=" << val;
130
130
        m_fVal = val;
131
131
        fixed = SANE_FIX(val);
132
132
        fromSANE_Word(data, fixed);
134
134
    }
135
135
}
136
136
 
 
137
bool KSaneOptFSlider::getMinValue(float &val)
 
138
{
 
139
    if (m_optDesc->constraint_type == SANE_CONSTRAINT_RANGE) {
 
140
        val = SANE_UNFIX(m_optDesc->constraint.range->min);
 
141
    }
 
142
    else {
 
143
        val = FIXED_MIN;
 
144
    }
 
145
    return true;
 
146
}
 
147
 
137
148
bool KSaneOptFSlider::getMaxValue(float &max)
138
149
{
139
150
    if (m_optDesc->constraint_type == SANE_CONSTRAINT_RANGE) {