/[svn]/qsampler/trunk/src/qsamplerOptions.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerOptions.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4042 by capela, Sun Feb 6 10:50:27 2022 UTC revision 4043 by capela, Sat Aug 27 11:46:11 2022 UTC
# Line 576  void Options::saveComboBoxHistory ( QCom Line 576  void Options::saveComboBoxHistory ( QCom
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());

Legend:
Removed from v.4042  
changed lines
  Added in v.4043

  ViewVC Help
Powered by ViewVC