Fixed getDCVersion() as part of turning worker-object into its own
thread.
This commit is contained in:
parent
685568d4f6
commit
7e4c138d1b
13
worker.cpp
13
worker.cpp
@ -963,15 +963,17 @@ QString Worker::getPluginVersion(QString const &pluginFileName) const {
|
||||
|
||||
QStringList Worker::getDCVersion() const {
|
||||
QStringList lst = (QStringList() << "N/A" << "N/A");
|
||||
hwinf *hwi = m_mainWindow->getPlugin();
|
||||
if (hwi) {
|
||||
hwi->dc_autoRequest(true); // turn auto-request setting on
|
||||
Update const *up = update();
|
||||
if (up) {
|
||||
hwinf const *caPlugin = up->hw();
|
||||
if (caPlugin) {
|
||||
caPlugin->dc_autoRequest(true); // turn auto-request setting on
|
||||
|
||||
QByteArray const cmp(8, char(0));
|
||||
QByteArray hw(""), sw("");
|
||||
for (int i=0; i<5; ++i) {
|
||||
hw = hwi->dc_getHWversion().toUtf8();
|
||||
sw = hwi->dc_getSWversion().toUtf8();
|
||||
hw = caPlugin->dc_getHWversion().toUtf8();
|
||||
sw = caPlugin->dc_getSWversion().toUtf8();
|
||||
if (!hw.startsWith(cmp)) {
|
||||
lst.clear();
|
||||
qInfo() << hw << sw;
|
||||
@ -981,6 +983,7 @@ QStringList Worker::getDCVersion() const {
|
||||
QThread::sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user