Commit 6de2958a authored by Kåre Särs's avatar Kåre Särs
Browse files

Re-enable canceling of ADF, or multi selection scans with scanCancel()

parent 5f53423e
......@@ -678,6 +678,7 @@ void KSaneWidget::scanCancel()
if (d->m_previewThread->isRunning()) {
d->m_previewThread->cancelScan();
}
d->m_cancelMultiScan = true;
}
void KSaneWidget::setPreviewResolution(float dpi)
......
......@@ -1101,6 +1101,7 @@ void KSaneWidgetPrivate::startFinalScan()
}
m_scanOngoing = true;
m_isPreview = false;
m_cancelMultiScan = false;
float x1 = 0, y1 = 0, x2 = 0, y2 = 0;
......@@ -1169,9 +1170,13 @@ void KSaneWidgetPrivate::oneFinalScanDone()
source.contains(QStringLiteral("Duplex"))) {
// in batch mode only one area can be scanned per page
//qDebug() << "source == " << source;
m_updProgressTmr.start();
m_scanThread->start();
return;
if (!m_cancelMultiScan) {
m_updProgressTmr.start();
m_scanThread->start();
m_cancelMultiScan = false;
return;
}
}
}
......@@ -1221,9 +1226,13 @@ void KSaneWidgetPrivate::oneFinalScanDone()
m_readValsTmr.stop();
valReload();
}
m_updProgressTmr.start();
m_scanThread->start();
return;
if (!m_cancelMultiScan) {
m_updProgressTmr.start();
m_scanThread->start();
m_cancelMultiScan = false;
return;
}
}
}
emit(q->scanDone(KSaneWidget::NoError, QStringLiteral("")));
......
......@@ -44,6 +44,8 @@ extern "C"
#include <QTabWidget>
#include <QPushButton>
#include <QVector>
#include <QSplitter>
#include <QToolButton>
#include "ksanewidget.h"
#include "ksaneoption.h"
......@@ -196,6 +198,7 @@ public:
bool m_scanOngoing;
bool m_closeDevicePending;
bool m_cancelMultiScan = false;
// final image data
QByteArray m_scanData;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment