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 Worker::getDCVersion() const {
|
||||||
QStringList lst = (QStringList() << "N/A" << "N/A");
|
QStringList lst = (QStringList() << "N/A" << "N/A");
|
||||||
hwinf *hwi = m_mainWindow->getPlugin();
|
Update const *up = update();
|
||||||
if (hwi) {
|
if (up) {
|
||||||
hwi->dc_autoRequest(true); // turn auto-request setting on
|
hwinf const *caPlugin = up->hw();
|
||||||
|
if (caPlugin) {
|
||||||
|
caPlugin->dc_autoRequest(true); // turn auto-request setting on
|
||||||
|
|
||||||
QByteArray const cmp(8, char(0));
|
QByteArray const cmp(8, char(0));
|
||||||
QByteArray hw(""), sw("");
|
QByteArray hw(""), sw("");
|
||||||
for (int i=0; i<5; ++i) {
|
for (int i=0; i<5; ++i) {
|
||||||
hw = hwi->dc_getHWversion().toUtf8();
|
hw = caPlugin->dc_getHWversion().toUtf8();
|
||||||
sw = hwi->dc_getSWversion().toUtf8();
|
sw = caPlugin->dc_getSWversion().toUtf8();
|
||||||
if (!hw.startsWith(cmp)) {
|
if (!hw.startsWith(cmp)) {
|
||||||
lst.clear();
|
lst.clear();
|
||||||
qInfo() << hw << sw;
|
qInfo() << hw << sw;
|
||||||
@ -981,6 +983,7 @@ QStringList Worker::getDCVersion() const {
|
|||||||
QThread::sleep(1);
|
QThread::sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user