* improved setting of combox value, fixed wrong text
* do NOT emit signals when same index
* getOwnCallsign
* do NOT used cache FPs for own aircraft
This commit is contained in:
Klaus Basan
2019-07-07 00:42:37 +02:00
committed by Mat Sutcliffe
parent 891a058f17
commit ea7b3316c9
10 changed files with 52 additions and 12 deletions

View File

@@ -250,11 +250,13 @@ namespace BlackGui
if (!box) { return false; }
if (!candidate.isEmpty())
{
const int ci = box->currentIndex();
for (int i = 0; i < box->count(); i++)
{
const QString t(box->itemText(i));
if (t.contains(candidate, Qt::CaseInsensitive))
{
if (ci == i) { return true; } // avoid signals
box->setCurrentIndex(i);
return true;
}
@@ -263,11 +265,13 @@ namespace BlackGui
// not found
if (unspecified.isEmpty()) { return false; }
const int ci = box->currentIndex();
for (int i = 0; i < box->count(); i++)
{
const QString t(box->itemText(i));
if (t.contains(unspecified, Qt::CaseInsensitive))
{
if (ci == i) { return true; } // avoid signals
box->setCurrentIndex(i);
return true;
}