diff options
Diffstat (limited to 'logic/runtime-libraries.cpp')
-rw-r--r-- | logic/runtime-libraries.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/logic/runtime-libraries.cpp b/logic/runtime-libraries.cpp index b91c9635..754f52cd 100644 --- a/logic/runtime-libraries.cpp +++ b/logic/runtime-libraries.cpp @@ -3,10 +3,16 @@ #include <QMessageBox> #include <QDebug> +#ifdef __clang__ +# pragma clang diagnostic ignored "-Wcomma" +#endif + runtime_libraries::runtime_libraries(QFrame* frame, dylibptr t, dylibptr p, dylibptr f) { + auto error = [](const QString& msg) { return module_status_mixin::error(msg); }; + module_status status = - module_status_mixin::error(tr("Library load failure")); + error(tr("Library load failure")); using namespace options; @@ -22,8 +28,8 @@ runtime_libraries::runtime_libraries(QFrame* frame, dylibptr t, dylibptr p, dyli if(status = pProtocol->initialize(), !status.is_ok()) { - status = tr("Error occurred while loading protocol %1\n\n%2\n") - .arg(p->name, status.error); + status = error(tr("Error occurred while loading protocol %1\n\n%2\n") + .arg(p->name, status.error)); goto end; } @@ -36,7 +42,7 @@ runtime_libraries::runtime_libraries(QFrame* frame, dylibptr t, dylibptr p, dyli goto end; } - if (f && !pFilter) + if (f && f->Constructor && !pFilter) { qDebug() << "filter load failure"; goto end; @@ -45,15 +51,15 @@ runtime_libraries::runtime_libraries(QFrame* frame, dylibptr t, dylibptr p, dyli if (pFilter) if(status = pFilter->initialize(), !status.is_ok()) { - status = tr("Error occurred while loading filter %1\n\n%2\n") - .arg(f->name, status.error); + status = error(tr("Error occurred while loading filter %1\n\n%2\n") + .arg(f->name, status.error)); goto end; } if (status = pTracker->start_tracker(frame), !status.is_ok()) { - status = tr("Error occurred while loading tracker %1\n\n%2\n") - .arg(t->name, status.error); + status = error(tr("Error occurred while loading tracker %1\n\n%2\n") + .arg(t->name, status.error)); goto end; } @@ -66,6 +72,8 @@ end: pProtocol = nullptr; if (!status.is_ok()) - QMessageBox::critical(nullptr, tr("Startup failure"), status.error, QMessageBox::Cancel, QMessageBox::NoButton); + QMessageBox::critical(nullptr, + tr("Startup failure"), status.error, + QMessageBox::Cancel, QMessageBox::NoButton); } |