Fixed getDCVersion() as part of turning worker-object into its own
thread.
This commit is contained in:
parent
685568d4f6
commit
7e4c138d1b
31
worker.cpp
31
worker.cpp
@ -963,22 +963,25 @@ 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();
|
||||
if (!hw.startsWith(cmp)) {
|
||||
lst.clear();
|
||||
qInfo() << hw << sw;
|
||||
lst << hw << sw;
|
||||
break;
|
||||
QByteArray const cmp(8, char(0));
|
||||
QByteArray hw(""), sw("");
|
||||
for (int i=0; i<5; ++i) {
|
||||
hw = caPlugin->dc_getHWversion().toUtf8();
|
||||
sw = caPlugin->dc_getSWversion().toUtf8();
|
||||
if (!hw.startsWith(cmp)) {
|
||||
lst.clear();
|
||||
qInfo() << hw << sw;
|
||||
lst << hw << sw;
|
||||
break;
|
||||
}
|
||||
QThread::sleep(1);
|
||||
}
|
||||
QThread::sleep(1);
|
||||
}
|
||||
}
|
||||
return lst;
|
||||
|
Loading…
Reference in New Issue
Block a user