576 |
{ |
{ |
577 |
const bool bBlockSignals = pComboBox->blockSignals(true); |
const bool bBlockSignals = pComboBox->blockSignals(true); |
578 |
|
|
|
// Add current text as latest item... |
|
|
const QString sCurrentText = pComboBox->currentText(); |
|
579 |
int iCount = pComboBox->count(); |
int iCount = pComboBox->count(); |
580 |
for (int i = 0; i < iCount; i++) { |
|
581 |
const QString& sText = pComboBox->itemText(i); |
// Add current text as latest item (if not blank)... |
582 |
if (sText == sCurrentText) { |
const QString& sCurrentText = pComboBox->currentText(); |
583 |
pComboBox->removeItem(i); |
if (!sCurrentText.isEmpty()) { |
584 |
--iCount; |
for (int i = 0; i < iCount; ++i) { |
585 |
break; |
const QString& sText = pComboBox->itemText(i); |
586 |
|
if (sText == sCurrentText) { |
587 |
|
pComboBox->removeItem(i); |
588 |
|
--iCount; |
589 |
|
break; |
590 |
|
} |
591 |
} |
} |
592 |
|
pComboBox->insertItem(0, sCurrentText); |
593 |
|
pComboBox->setCurrentIndex(0); |
594 |
|
++iCount; |
595 |
} |
} |
596 |
|
|
597 |
while (iCount >= iLimit) |
while (iCount >= iLimit) |
598 |
pComboBox->removeItem(--iCount); |
pComboBox->removeItem(--iCount); |
|
pComboBox->insertItem(0, sCurrentText); |
|
|
pComboBox->setCurrentIndex(0); |
|
|
++iCount; |
|
599 |
|
|
600 |
// Save combobox list to configuration settings file... |
// Save combobox list to configuration settings file... |
601 |
m_settings.beginGroup("/History/" + pComboBox->objectName()); |
m_settings.beginGroup("/History/" + pComboBox->objectName()); |