Changeset View
Changeset View
Standalone View
Standalone View
scan/sanedialog.cpp
Show All 31 Lines | |||||
32 | #include <KWindowConfig> | 32 | #include <KWindowConfig> | ||
33 | #include <KConfigGroup> | 33 | #include <KConfigGroup> | ||
34 | 34 | | |||
35 | #include <QPushButton> | 35 | #include <QPushButton> | ||
36 | 36 | | |||
37 | SaneDialog::SaneDialog(QWidget *parent) | 37 | SaneDialog::SaneDialog(QWidget *parent) | ||
38 | : KPageDialog(parent) | 38 | : KPageDialog(parent) | ||
39 | { | 39 | { | ||
40 | setFaceType((KPageDialog::FaceType)Plain); | 40 | setFaceType(static_cast<KPageDialog::FaceType> (Plain)); | ||
41 | setWindowTitle(i18nc("@title:window", "Acquire Image")); | 41 | setWindowTitle(i18nc("@title:window", "Acquire Image")); | ||
42 | 42 | | |||
43 | buttonBox()->setStandardButtons(QDialogButtonBox::Close); | 43 | buttonBox()->setStandardButtons(QDialogButtonBox::Close); | ||
44 | buttonBox()->button(QDialogButtonBox::Close)->setDefault(true); | 44 | buttonBox()->button(QDialogButtonBox::Close)->setDefault(true); | ||
45 | 45 | | |||
46 | 46 | | |||
47 | m_ksanew = new KSaneIface::KSaneWidget(this); | 47 | m_ksanew = new KSaneIface::KSaneWidget(this); | ||
48 | addPage(m_ksanew, QString()); | 48 | addPage(m_ksanew, QString()); | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 94 | if (m_ksanew && !m_openDev.isEmpty()) { | |||
103 | for (; i != opts.constEnd(); ++i) | 103 | for (; i != opts.constEnd(); ++i) | ||
104 | group.writeEntry(i.key(), i.value(), KConfigGroup::Persistent); | 104 | group.writeEntry(i.key(), i.value(), KConfigGroup::Persistent); | ||
105 | } | 105 | } | ||
106 | } | 106 | } | ||
107 | 107 | | |||
108 | void SaneDialog::imageReady(QByteArray &data, int w, int h, int bpl, int f) | 108 | void SaneDialog::imageReady(QByteArray &data, int w, int h, int bpl, int f) | ||
109 | { | 109 | { | ||
110 | /* copy the image data into img */ | 110 | /* copy the image data into img */ | ||
111 | QImage img = m_ksanew->toQImage(data, w, h, bpl, (KSaneIface::KSaneWidget::ImageFormat)f); | 111 | QImage img = m_ksanew->toQImage(data, w, h, bpl, static_cast<KSaneIface::KSaneWidget::ImageFormat> (f)); | ||
112 | emit finalImage(img, nextId()); | 112 | emit finalImage(img, nextId()); | ||
113 | } | 113 | } | ||
114 | 114 | | |||
115 | int SaneDialog::nextId() | 115 | int SaneDialog::nextId() | ||
116 | { | 116 | { | ||
117 | return ++m_currentId; | 117 | return ++m_currentId; | ||
118 | } | 118 | } |