diff --git a/src/ksanewidget.h b/src/ksanewidget.h --- a/src/ksanewidget.h +++ b/src/ksanewidget.h @@ -211,7 +211,8 @@ /** This method can be used to write many parameter values at once. * @param opts is a QMap with the parameter names and values. - * @return This function returns the number of successful writes. */ + * @return This function returns the number of successful writes + * or -1 if scanning is in progress. */ int setOptVals(const QMap &opts); /** This function reads one parameter value into a string. diff --git a/src/ksanewidget.cpp b/src/ksanewidget.cpp --- a/src/ksanewidget.cpp +++ b/src/ksanewidget.cpp @@ -718,6 +718,11 @@ int KSaneWidget::setOptVals(const QMap &opts) { + if (d->m_scanThread->isRunning() || + d->m_previewThread->isRunning()) { + return -1; + } + QString tmp; int i; int ret = 0;