Do not update model set in mapping component if same value

This commit is contained in:
Klaus Basan
2018-07-04 21:10:36 +02:00
parent b345d6e9de
commit dd5028fa39
3 changed files with 20 additions and 8 deletions

View File

@@ -13,8 +13,10 @@
#include "blackgui/uppercasevalidator.h"
#include "blackcore/webdataservices.h"
#include "blackcore/context/contextsimulator.h"
#include <QRadioButton>
#include <QStringListModel>
#include <QPointer>
using namespace BlackCore;
using namespace BlackCore::Context;
@@ -107,7 +109,12 @@ namespace BlackGui
if (this->getSimulator() == simulator) { return false; }
m_currentSimulator = simulator;
m_modelCaches.setCurrentSimulator(simulator); // all models
QTimer::singleShot(100, this, [ = ] { this->setCompleter(true); });
QPointer<CAircraftModelStringCompleter> myself(this);
QTimer::singleShot(100, this, [ = ]
{
if (!myself) { return; }
this->setCompleter(true);
});
return true;
}