diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index e0ff2fadb..3847cdcaf 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -515,12 +515,9 @@ namespace BlackCore void CApplication::processEventsFor(int milliseconds) { - const QTime end = QTime::currentTime().addMSecs(milliseconds); - while (QTime::currentTime() <= end) - { - QCoreApplication::processEvents(); - QThread::msleep(100); - } + QEventLoop eventLoop; + QTimer::singleShot(milliseconds, &eventLoop, &QEventLoop::quit); + eventLoop.exec(); } bool CApplication::useContexts(const CCoreFacadeConfig &coreConfig) diff --git a/src/blackcore/db/databasereader.cpp b/src/blackcore/db/databasereader.cpp index 8ac77e675..dd3c7e4db 100644 --- a/src/blackcore/db/databasereader.cpp +++ b/src/blackcore/db/databasereader.cpp @@ -148,7 +148,7 @@ namespace BlackCore // Using timer to first finish this function, then the resulting signal if (validInCacheEntities != CEntityFlags::NoEntity) { - QTimer::singleShot(10, this, [ = ] + QTimer::singleShot(0, this, [ = ] { emit this->dataRead(validInCacheEntities, CEntityFlags::ReadFinished, 0); }); diff --git a/src/blackcore/webdataservices.h b/src/blackcore/webdataservices.h index 5cd42dac8..b842cc7ef 100644 --- a/src/blackcore/webdataservices.h +++ b/src/blackcore/webdataservices.h @@ -291,11 +291,11 @@ namespace BlackCore BlackMisc::CCountry getCountryForName(const QString &name) const; //! Get airports - //! \\threadsafe + //! \threadsafe BlackMisc::Aviation::CAirportList getAirports() const; //! Get airports count - //! \\threadsafe + //! \threadsafe int getAirportsCount() const; //! Get METARs diff --git a/src/blackgui/components/textmessagecomponent.cpp b/src/blackgui/components/textmessagecomponent.cpp index 6e2e849c6..ed5146a86 100644 --- a/src/blackgui/components/textmessagecomponent.cpp +++ b/src/blackgui/components/textmessagecomponent.cpp @@ -18,6 +18,7 @@ #include "blackgui/textmessagetextedit.h" #include "blackgui/views/textmessageview.h" #include "blackgui/views/viewbase.h" +#include "blackmisc/verify.h" #include "blackmisc/audio/notificationsounds.h" #include "blackmisc/aviation/atcstation.h" #include "blackmisc/aviation/callsign.h" @@ -287,7 +288,7 @@ namespace BlackGui if (!tab) { tab = this->addNewTextMessageTab(cs); } Q_ASSERT_X(tab, Q_FUNC_INFO, "Missing tab"); CTextMessageTextEdit *textEdit = tab->findChild(); - Q_ASSERT_X(textEdit, Q_FUNC_INFO, "Missing text edit"); + BLACK_VERIFY_X(textEdit, Q_FUNC_INFO, "Missing text edit"); if (!textEdit) { return; } // do not crash, though this situation could not happen textEdit->insertTextMessage(textMessage); diff --git a/src/blackmisc/applicationinfolist.cpp b/src/blackmisc/applicationinfolist.cpp index 6dbb197a8..f34071b16 100644 --- a/src/blackmisc/applicationinfolist.cpp +++ b/src/blackmisc/applicationinfolist.cpp @@ -7,8 +7,6 @@ * contained in the LICENSE file. */ -//! \file - #include "blackmisc/applicationinfolist.h" namespace BlackMisc diff --git a/src/blackmisc/aviation/airport.cpp b/src/blackmisc/aviation/airport.cpp index b231257c1..611d9a4ab 100644 --- a/src/blackmisc/aviation/airport.cpp +++ b/src/blackmisc/aviation/airport.cpp @@ -42,7 +42,6 @@ namespace BlackMisc { if (!this->m_country.hasIsoCode() && airport.getCountry().hasIsoCode()) { this->m_country = airport.getCountry(); } if (this->m_descriptiveName.isEmpty()) { this->m_descriptiveName = airport.getDescriptiveName(); } - if (this->m_descriptiveName.isEmpty()) { this->m_descriptiveName = airport.getDescriptiveName(); } } QString CAirport::convertToQString(bool i18n) const diff --git a/src/swiftguistandard/swiftguistd.cpp b/src/swiftguistandard/swiftguistd.cpp index def807a73..de84215f1 100644 --- a/src/swiftguistandard/swiftguistd.cpp +++ b/src/swiftguistandard/swiftguistd.cpp @@ -412,7 +412,7 @@ void SwiftGuiStd::ps_sharedFilesHeadersLoaded() sm = CStatusMessage(this).info("Load data for '%1'?") << CEntityFlags::flagToString(newSingleEntity); sms.push_back(sm); } - auto lambda = [this, newEntities]() + auto lambda = [newEntities]() { sGui->getWebDataServices()->triggerLoadingDirectlyFromSharedFiles(newEntities, false); };