/[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 1803 by schoenebeck, Sun Dec 7 13:58:16 2008 UTC revision 3837 by capela, Tue Dec 1 17:46:41 2020 UTC
# Line 1  Line 1 
1  // qsamplerOptions.cpp  // qsamplerOptions.cpp
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2004-2008, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2020, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007, Christian Schoenebeck     Copyright (C) 2007,2008,2015 Christian Schoenebeck
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
8     modify it under the terms of the GNU General Public License     modify it under the terms of the GNU General Public License
# Line 27  Line 27 
27  #include <QTextStream>  #include <QTextStream>
28  #include <QComboBox>  #include <QComboBox>
29    
30    #include <QApplication>
31    
32    #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
33    #include <QDesktopWidget>
34    #endif
35    
36  #include <lscp/client.h>  #include <lscp/client.h>
37    
38  #ifdef CONFIG_LIBGIG  #ifdef CONFIG_LIBGIG
# Line 44  namespace QSampler { Line 50  namespace QSampler {
50  Options::Options (void)  Options::Options (void)
51          : m_settings(QSAMPLER_DOMAIN, QSAMPLER_TITLE)          : m_settings(QSAMPLER_DOMAIN, QSAMPLER_TITLE)
52  {  {
53            loadOptions();
54    }
55    
56    
57    // Default Destructor.
58    Options::~Options (void)
59    {
60            saveOptions();
61    }
62    
63    
64    // Explicit load method.
65    void Options::loadOptions (void)
66    {
67          // Begin into general options group.          // Begin into general options group.
68          m_settings.beginGroup("/Options");          m_settings.beginGroup("/Options");
69    
# Line 51  Options::Options (void) Line 71  Options::Options (void)
71          m_settings.beginGroup("/Server");          m_settings.beginGroup("/Server");
72          sServerHost    = m_settings.value("/ServerHost", "localhost").toString();          sServerHost    = m_settings.value("/ServerHost", "localhost").toString();
73          iServerPort    = m_settings.value("/ServerPort", 8888).toInt();          iServerPort    = m_settings.value("/ServerPort", 8888).toInt();
74          #if defined(__APPLE__)  //  Toshi Nagata 20080105  #if defined(__APPLE__)  //  Toshi Nagata 20080105
75          //  TODO: Should this be a configure option?          //  TODO: Should this be a configure option?
76          iServerTimeout = m_settings.value("/ServerTimeout", 10000).toInt();          iServerTimeout = m_settings.value("/ServerTimeout", 10000).toInt();
77          #else  #else
78          iServerTimeout = m_settings.value("/ServerTimeout", 1000).toInt();          iServerTimeout = m_settings.value("/ServerTimeout", 1000).toInt();
79          #endif  #endif
80          bServerStart   = m_settings.value("/ServerStart", true).toBool();          bServerStart   = m_settings.value("/ServerStart", true).toBool();
81          #if defined(__APPLE__)  //  Toshi Nagata 20080113  #if defined(__APPLE__)
82          sServerCmdLine = m_settings.value("/ServerCmdLine", "linuxsampler.starter").toString();          sServerCmdLine = m_settings.value("/ServerCmdLine", "/usr/local/bin/linuxsampler").toString();
83          #else  #else
84          sServerCmdLine = m_settings.value("/ServerCmdLine", "linuxsampler").toString();          sServerCmdLine = m_settings.value("/ServerCmdLine", "linuxsampler").toString();
85          #endif  #endif
86          iStartDelay    = m_settings.value("/StartDelay", 3).toInt();          iStartDelay    = m_settings.value("/StartDelay", 3).toInt();
87          m_settings.endGroup();          m_settings.endGroup();
88    
# Line 83  Options::Options (void) Line 103  Options::Options (void)
103          bMessagesLimit   = m_settings.value("/MessagesLimit", true).toBool();          bMessagesLimit   = m_settings.value("/MessagesLimit", true).toBool();
104          iMessagesLimitLines = m_settings.value("/MessagesLimitLines", 1000).toInt();          iMessagesLimitLines = m_settings.value("/MessagesLimitLines", 1000).toInt();
105          bConfirmRemove   = m_settings.value("/ConfirmRemove", true).toBool();          bConfirmRemove   = m_settings.value("/ConfirmRemove", true).toBool();
106            bConfirmReset    = m_settings.value("/ConfirmReset", true).toBool();
107            bConfirmRestart  = m_settings.value("/ConfirmRestart", true).toBool();
108            bConfirmError    = m_settings.value("/ConfirmError", true).toBool();
109          bKeepOnTop       = m_settings.value("/KeepOnTop", true).toBool();          bKeepOnTop       = m_settings.value("/KeepOnTop", true).toBool();
110          bStdoutCapture   = m_settings.value("/StdoutCapture", true).toBool();          bStdoutCapture   = m_settings.value("/StdoutCapture", true).toBool();
111          bCompletePath    = m_settings.value("/CompletePath", true).toBool();          bCompletePath    = m_settings.value("/CompletePath", true).toBool();
# Line 90  Options::Options (void) Line 113  Options::Options (void)
113          iBaseFontSize    = m_settings.value("/BaseFontSize", 0).toInt();          iBaseFontSize    = m_settings.value("/BaseFontSize", 0).toInt();
114  // if libgig provides a fast way to retrieve instrument names even for large  // if libgig provides a fast way to retrieve instrument names even for large
115  // .gig files, then we enable this feature by default  // .gig files, then we enable this feature by default
116  #if HAVE_LIBGIG_SETAUTOLOAD  #ifdef CONFIG_LIBGIG_SETAUTOLOAD
117          bInstrumentNames = m_settings.value("/InstrumentNames", true).toBool();          bInstrumentNames = m_settings.value("/InstrumentNames", true).toBool();
118  #else  #else
119          bInstrumentNames = m_settings.value("/InstrumentNames", false).toBool();          bInstrumentNames = m_settings.value("/InstrumentNames", false).toBool();
120  #endif  #endif
121          m_settings.endGroup();          m_settings.endGroup();
122    
123            // Load custom options...
124            m_settings.beginGroup("/Custom");
125            sCustomColorTheme = m_settings.value("/ColorTheme").toString();
126            sCustomStyleTheme = m_settings.value("/StyleTheme").toString();
127            m_settings.endGroup();
128    
129          // And go into view options group.          // And go into view options group.
130          m_settings.beginGroup("/View");          m_settings.beginGroup("/View");
131          bMenubar     = m_settings.value("/Menubar", true).toBool();          bMenubar     = m_settings.value("/Menubar", true).toBool();
# Line 140  Options::Options (void) Line 169  Options::Options (void)
169  }  }
170    
171    
172  // Default Destructor.  // Explicit save method.
173  Options::~Options (void)  void Options::saveOptions (void)
174  {  {
175          // Make program version available in the future.          // Make program version available in the future.
176          m_settings.beginGroup("/Program");          m_settings.beginGroup("/Program");
177          m_settings.setValue("/Version", QSAMPLER_VERSION);          m_settings.setValue("/Version", CONFIG_BUILD_VERSION);
178          m_settings.endGroup();          m_settings.endGroup();
179    
180          // And go into general options group.          // And go into general options group.
# Line 178  Options::~Options (void) Line 207  Options::~Options (void)
207          m_settings.setValue("/MessagesLimit", bMessagesLimit);          m_settings.setValue("/MessagesLimit", bMessagesLimit);
208          m_settings.setValue("/MessagesLimitLines", iMessagesLimitLines);          m_settings.setValue("/MessagesLimitLines", iMessagesLimitLines);
209          m_settings.setValue("/ConfirmRemove", bConfirmRemove);          m_settings.setValue("/ConfirmRemove", bConfirmRemove);
210            m_settings.setValue("/ConfirmReset", bConfirmReset);
211            m_settings.setValue("/ConfirmRestart", bConfirmRestart);
212            m_settings.setValue("/ConfirmError", bConfirmError);
213          m_settings.setValue("/KeepOnTop", bKeepOnTop);          m_settings.setValue("/KeepOnTop", bKeepOnTop);
214          m_settings.setValue("/StdoutCapture", bStdoutCapture);          m_settings.setValue("/StdoutCapture", bStdoutCapture);
215          m_settings.setValue("/CompletePath", bCompletePath);          m_settings.setValue("/CompletePath", bCompletePath);
# Line 186  Options::~Options (void) Line 218  Options::~Options (void)
218          m_settings.setValue("/InstrumentNames", bInstrumentNames);          m_settings.setValue("/InstrumentNames", bInstrumentNames);
219          m_settings.endGroup();          m_settings.endGroup();
220    
221            // Save custom options...
222            m_settings.beginGroup("/Custom");
223            m_settings.setValue("/ColorTheme", sCustomColorTheme);
224            m_settings.setValue("/StyleTheme", sCustomStyleTheme);
225            m_settings.endGroup();
226    
227          // View options group.          // View options group.
228          m_settings.beginGroup("/View");          m_settings.beginGroup("/View");
229          m_settings.setValue("/Menubar", bMenubar);          m_settings.setValue("/Menubar", bMenubar);
# Line 225  Options::~Options (void) Line 263  Options::~Options (void)
263          m_settings.setValue("/Volume", iVolume);          m_settings.setValue("/Volume", iVolume);
264          m_settings.setValue("/Loadmode", iLoadMode);          m_settings.setValue("/Loadmode", iLoadMode);
265          m_settings.endGroup();          m_settings.endGroup();
266    
267            // Save/commit to disk.
268            m_settings.sync();
269  }  }
270    
271    
272  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
273  // Settings accessor.  // Settings accessor.
274  //  //
# Line 242  QSettings& Options::settings (void) Line 284  QSettings& Options::settings (void)
284  //  //
285    
286  // Help about command line options.  // Help about command line options.
287  void Options::print_usage ( const char *arg0 )  void Options::print_usage ( const QString& arg0 )
288  {  {
289          QTextStream out(stderr);          QTextStream out(stderr);
290          out << QObject::tr("Usage: %1 [options] [session-file]\n\n"          out << QObject::tr("Usage: %1 [options] [session-file]\n\n"
291                  QSAMPLER_TITLE " - " QSAMPLER_SUBTITLE "\n\n"                  QSAMPLER_TITLE " - " QSAMPLER_SUBTITLE "\n\n"
292                  "Options:\n\n"                  "Options:\n\n"
293                  "  -s, --start\n\tStart linuxsampler server locally\n\n"                  "  -s, --start\n\tStart linuxsampler server locally\n\n"
294                  "  -h, --hostname\n\tSpecify linuxsampler server hostname\n\n"                  "  -h, --hostname\n\tSpecify linuxsampler server hostname (default = localhost)\n\n"
295                  "  -p, --port\n\tSpecify linuxsampler server port number\n\n"                  "  -p, --port\n\tSpecify linuxsampler server port number (default = 8888)\n\n"
296                  "  -?, --help\n\tShow help about command line options\n\n"                  "  -?, --help\n\tShow help about command line options\n\n"
297                  "  -v, --version\n\tShow version information\n\n")                  "  -v, --version\n\tShow version information\n\n")
298                  .arg(arg0);                  .arg(arg0);
# Line 258  void Options::print_usage ( const char * Line 300  void Options::print_usage ( const char *
300    
301    
302  // Parse command line arguments into m_settings.  // Parse command line arguments into m_settings.
303  bool Options::parse_args ( int argc, char **argv )  bool Options::parse_args ( const QStringList& args )
304  {  {
305          QTextStream out(stderr);          QTextStream out(stderr);
306          const QString sEol = "\n\n";          const QString sEol = "\n\n";
307            const int argc = args.count();
308          int iCmdArgs = 0;          int iCmdArgs = 0;
309    
310          for (int i = 1; i < argc; i++) {          for (int i = 1; i < argc; ++i) {
311    
312                  if (iCmdArgs > 0) {                  if (iCmdArgs > 0) {
313                          sSessionFile += " ";                          sSessionFile += " ";
314                          sSessionFile += argv[i];                          sSessionFile += args.at(i);
315                          iCmdArgs++;                          ++iCmdArgs;
316                          continue;                          continue;
317                  }                  }
318    
319                  QString sArg = argv[i];                  QString sArg = args.at(i);
320                  QString sVal = QString::null;                  QString sVal;
321                  int iEqual = sArg.indexOf("=");                  const int iEqual = sArg.indexOf("=");
322                  if (iEqual >= 0) {                  if (iEqual >= 0) {
323                          sVal = sArg.right(sArg.length() - iEqual - 1);                          sVal = sArg.right(sArg.length() - iEqual - 1);
324                          sArg = sArg.left(iEqual);                          sArg = sArg.left(iEqual);
325                  }                  }
326                  else if (i < argc)                  else if (i < argc - 1) {
327                          sVal = argv[i + 1];                          sVal = args.at(i + 1);
328                            if (sVal[0] == '-')
329                                    sVal.clear();
330                    }
331    
332                  if (sArg == "-s" || sArg == "--start") {                  if (sArg == "-s" || sArg == "--start") {
333                          bServerStart = true;                          bServerStart = true;
334                  }                  }
335                  else if (sArg == "-h" || sArg == "--hostname") {                  else if (sArg == "-h" || sArg == "--hostname") {
336                          if (sVal.isNull()) {                          if (sVal.isNull()) {
337                                  out << QObject::tr("Option -h requires an argument (hostname).") + sEol;                                  out << QObject::tr("Option -h requires an argument (host).") + sEol;
338                                  return false;                                  return false;
339                          }                          }
340                          sServerHost = sVal;                          sServerHost = sVal;
341                          if (iEqual < 0)                          if (iEqual < 0)
342                                  i++;                                  ++i;
343                  }                  }
344                  else if (sArg == "-p" || sArg == "--port") {                  else if (sArg == "-p" || sArg == "--port") {
345                          if (sVal.isNull()) {                          if (sVal.isNull()) {
# Line 302  bool Options::parse_args ( int argc, cha Line 348  bool Options::parse_args ( int argc, cha
348                          }                          }
349                          iServerPort = sVal.toInt();                          iServerPort = sVal.toInt();
350                          if (iEqual < 0)                          if (iEqual < 0)
351                                  i++;                                  ++i;
352                  }                  }
353                  else if (sArg == "-?" || sArg == "--help") {                  else if (sArg == "-?" || sArg == "--help") {
354                          print_usage(argv[0]);                          print_usage(args.at(0));
355                          return false;                          return false;
356                  }                  }
357                  else if (sArg == "-v" || sArg == "--version") {                  else if (sArg == "-v" || sArg == "--version") {
358                          out << QObject::tr("Qt: %1\n").arg(qVersion());                          out << QString("Qt: %1").arg(qVersion());
359  #ifdef CONFIG_LIBGIG                  #if defined(QT_STATIC)
360                            out << "-static";
361                    #endif
362                            out << '\n';
363                            out << QString("%1: %2\n")
364                                    .arg(QSAMPLER_TITLE)
365                                    .arg(CONFIG_BUILD_VERSION);
366                    #ifdef CONFIG_LIBGIG
367                          out << QString("%1: %2\n")                          out << QString("%1: %2\n")
368                                  .arg(gig::libraryName().c_str())                                  .arg(gig::libraryName().c_str())
369                                  .arg(gig::libraryVersion().c_str());                                  .arg(gig::libraryVersion().c_str());
370  #endif                  #endif
371                          out << QString("%1: %2\n")                          out << QString("%1: %2\n")
372                                  .arg(::lscp_client_package())                                  .arg(::lscp_client_package())
373                                  .arg(::lscp_client_version());                                  .arg(::lscp_client_version());
                         out << QObject::tr(QSAMPLER_TITLE ": %1\n").arg(QSAMPLER_VERSION);  
374                          return false;                          return false;
375                  }                  }
376                  else {                  else {
377                          // If we don't have one by now,                          // If we don't have one by now,
378                          // this will be the startup sesion file...                          // this will be the startup sesion file...
379                          sSessionFile += sArg;                          sSessionFile += sArg;
380                          iCmdArgs++;                          ++iCmdArgs;
381                  }                  }
382          }          }
383    
# Line 337  bool Options::parse_args ( int argc, cha Line 389  bool Options::parse_args ( int argc, cha
389  //---------------------------------------------------------------------------  //---------------------------------------------------------------------------
390  // Widget geometry persistence helper methods.  // Widget geometry persistence helper methods.
391    
392  void Options::loadWidgetGeometry ( QWidget *pWidget )  void Options::loadWidgetGeometry ( QWidget *pWidget, bool bVisible )
393  {  {
394          // Try to restore old form window positioning.          // Try to restore old form window positioning.
395          if (pWidget) {          if (pWidget) {
396                  QPoint fpos;          //      if (bVisible) pWidget->show(); -- force initial exposure?
                 QSize  fsize;  
                 bool bVisible;  
397                  m_settings.beginGroup("/Geometry/" + pWidget->objectName());                  m_settings.beginGroup("/Geometry/" + pWidget->objectName());
398                  fpos.setX(m_settings.value("/x", -1).toInt());          #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
399                  fpos.setY(m_settings.value("/y", -1).toInt());                  const QByteArray& geometry
400                  fsize.setWidth(m_settings.value("/width", -1).toInt());                          = m_settings.value("/geometry").toByteArray();
401                  fsize.setHeight(m_settings.value("/height", -1).toInt());                  if (geometry.isEmpty()) {
402                  bVisible = m_settings.value("/visible", false).toBool();                          QWidget *pParent = pWidget->parentWidget();
403                  m_settings.endGroup();                          if (pParent)
404                  if (fpos.x() > 0 && fpos.y() > 0)                                  pParent = pParent->window();
405                          pWidget->move(fpos);                  #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
406                  if (fsize.width() > 0 && fsize.height() > 0)                          if (pParent == nullptr)
407                          pWidget->resize(fsize);                                  pParent = QApplication::desktop();
408                  else                  #endif
409                          pWidget->adjustSize();                          if (pParent) {
410                                    QRect wrect(pWidget->geometry());
411                                    wrect.moveCenter(pParent->geometry().center());
412                                    pWidget->move(wrect.topLeft());
413                            }
414                    } else {
415                            pWidget->restoreGeometry(geometry);
416                    }
417            #else//--LOAD_OLD_GEOMETRY
418                    QPoint wpos;
419                    QSize  wsize;
420                    wpos.setX(m_settings.value("/x", -1).toInt());
421                    wpos.setY(m_settings.value("/y", -1).toInt());
422                    wsize.setWidth(m_settings.value("/width", -1).toInt());
423                    wsize.setHeight(m_settings.value("/height", -1).toInt());
424                    if (wpos.x() > 0 && wpos.y() > 0)
425                            pWidget->move(wpos);
426                    if (wsize.width() > 0 && wsize.height() > 0)
427                            pWidget->resize(wsize);
428            #endif
429            //      else
430            //      pWidget->adjustSize();
431                    if (!bVisible)
432                            bVisible = m_settings.value("/visible", false).toBool();
433                  if (bVisible)                  if (bVisible)
434                          pWidget->show();                          pWidget->show();
435                  else                  else
436                          pWidget->hide();                          pWidget->hide();
437                    m_settings.endGroup();
438          }          }
439  }  }
440    
441    
442  void Options::saveWidgetGeometry ( QWidget *pWidget )  void Options::saveWidgetGeometry ( QWidget *pWidget, bool bVisible )
443  {  {
444          // Try to save form window position...          // Try to save form window position...
445          // (due to X11 window managers ideossincrasies, we better          // (due to X11 window managers ideossincrasies, we better
446          // only save the form geometry while its up and visible)          // only save the form geometry while its up and visible)
447          if (pWidget) {          if (pWidget) {
448                  m_settings.beginGroup("/Geometry/" + pWidget->objectName());                  m_settings.beginGroup("/Geometry/" + pWidget->objectName());
449                  bool bVisible = pWidget->isVisible();          #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
450                  const QPoint& fpos  = pWidget->pos();                  m_settings.setValue("/geometry", pWidget->saveGeometry());
451                  const QSize&  fsize = pWidget->size();          #else//--SAVE_OLD_GEOMETRY
452                  m_settings.setValue("/x", fpos.x());                  const QPoint& wpos  = pWidget->pos();
453                  m_settings.setValue("/y", fpos.y());                  const QSize&  wsize = pWidget->size();
454                  m_settings.setValue("/width", fsize.width());                  m_settings.setValue("/x", wpos.x());
455                  m_settings.setValue("/height", fsize.height());                  m_settings.setValue("/y", wpos.y());
456                    m_settings.setValue("/width", wsize.width());
457                    m_settings.setValue("/height", wsize.height());
458            #endif
459                    if (!bVisible) bVisible = pWidget->isVisible();
460                  m_settings.setValue("/visible", bVisible);                  m_settings.setValue("/visible", bVisible);
461                  m_settings.endGroup();                  m_settings.endGroup();
462          }          }
# Line 390  void Options::saveWidgetGeometry ( QWidg Line 468  void Options::saveWidgetGeometry ( QWidg
468    
469  void Options::loadComboBoxHistory ( QComboBox *pComboBox, int iLimit )  void Options::loadComboBoxHistory ( QComboBox *pComboBox, int iLimit )
470  {  {
471            const bool bBlockSignals = pComboBox->blockSignals(true);
472    
473          // Load combobox list from configuration settings file...          // Load combobox list from configuration settings file...
474          m_settings.beginGroup("/History/" + pComboBox->objectName());          m_settings.beginGroup("/History/" + pComboBox->objectName());
475    
# Line 397  void Options::loadComboBoxHistory ( QCom Line 477  void Options::loadComboBoxHistory ( QCom
477                  pComboBox->setUpdatesEnabled(false);                  pComboBox->setUpdatesEnabled(false);
478                  pComboBox->setDuplicatesEnabled(false);                  pComboBox->setDuplicatesEnabled(false);
479                  pComboBox->clear();                  pComboBox->clear();
480                  for (int i = 0; i < iLimit; i++) {                  for (int i = 0; i < iLimit; ++i) {
481                          const QString& sText = m_settings.value(                          const QString& sText = m_settings.value(
482                                  "/Item" + QString::number(i + 1)).toString();                                  "/Item" + QString::number(i + 1)).toString();
483                          if (sText.isEmpty())                          if (sText.isEmpty())
# Line 408  void Options::loadComboBoxHistory ( QCom Line 488  void Options::loadComboBoxHistory ( QCom
488          }          }
489    
490          m_settings.endGroup();          m_settings.endGroup();
491    
492            pComboBox->blockSignals(bBlockSignals);
493  }  }
494    
495    
496  void Options::saveComboBoxHistory ( QComboBox *pComboBox, int iLimit )  void Options::saveComboBoxHistory ( QComboBox *pComboBox, int iLimit )
497  {  {
498            const bool bBlockSignals = pComboBox->blockSignals(true);
499    
500          // Add current text as latest item...          // Add current text as latest item...
501          const QString& sCurrentText = pComboBox->currentText();          const QString sCurrentText = pComboBox->currentText();
502          int iCount = pComboBox->count();          int iCount = pComboBox->count();
503          for (int i = 0; i < iCount; i++) {          for (int i = 0; i < iCount; i++) {
504                  const QString& sText = pComboBox->itemText(i);                  const QString& sText = pComboBox->itemText(i);
505                  if (sText == sCurrentText) {                  if (sText == sCurrentText) {
506                          pComboBox->removeItem(i);                          pComboBox->removeItem(i);
507                          iCount--;                          --iCount;
508                          break;                          break;
509                  }                  }
510          }          }
511          while (iCount >= iLimit)          while (iCount >= iLimit)
512                  pComboBox->removeItem(--iCount);                  pComboBox->removeItem(--iCount);
513          pComboBox->insertItem(0, sCurrentText);          pComboBox->insertItem(0, sCurrentText);
514          iCount++;          pComboBox->setCurrentIndex(0);
515            ++iCount;
516    
517          // Save combobox list to configuration settings file...          // Save combobox list to configuration settings file...
518          m_settings.beginGroup("/History/" + pComboBox->objectName());          m_settings.beginGroup("/History/" + pComboBox->objectName());
519          for (int i = 0; i < iCount; i++) {          for (int i = 0; i < iCount; ++i) {
520                  const QString& sText = pComboBox->itemText(i);                  const QString& sText = pComboBox->itemText(i);
521                  if (sText.isEmpty())                  if (sText.isEmpty())
522                          break;                          break;
523                  m_settings.setValue("/Item" + QString::number(i + 1), sText);                  m_settings.setValue("/Item" + QString::number(i + 1), sText);
524          }          }
525          m_settings.endGroup();          m_settings.endGroup();
526    
527            pComboBox->blockSignals(bBlockSignals);
528  }  }
529    
530    
531  int Options::getMaxVoices() {  int Options::getMaxVoices() {
532  #ifndef CONFIG_MAX_VOICES  #ifndef CONFIG_MAX_VOICES
533          return -1;          return -1;
# Line 537  void Options::sendFineTuningSettings() { Line 625  void Options::sendFineTuningSettings() {
625    
626    
627  // end of qsamplerOptions.cpp  // end of qsamplerOptions.cpp
628    

Legend:
Removed from v.1803  
changed lines
  Added in v.3837

  ViewVC Help
Powered by ViewVC