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

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

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

revision 1668 by schoenebeck, Tue Feb 5 15:42:33 2008 UTC revision 2387 by capela, Sat Dec 29 00:21:11 2012 UTC
# Line 1  Line 1 
1  // qsamplerFxSendList.cpp  // qsamplerFxSendList.cpp
2  //  //
3  /****************************************************************************  /****************************************************************************
4       Copyright (C) 2010-2012, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2008, Christian Schoenebeck     Copyright (C) 2008, 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
# Line 68  QVariant FxSendsModel::data(const QModel Line 69  QVariant FxSendsModel::data(const QModel
69                          break;                          break;
70                  case Qt::DecorationRole:                  case Qt::DecorationRole:
71                          if (m_FxSends[index.row()].deletion())                          if (m_FxSends[index.row()].deletion())
72                                  return QIcon(":/icons/formRemove.png");                                  return QIcon(":/images/formRemove.png");
73                          if (m_FxSends[index.row()].isNew())                          if (m_FxSends[index.row()].isNew())
74                                  return QIcon(":/icons/itemNew.png");                                  return QIcon(":/images/itemNew.png");
75                          if (m_FxSends[index.row()].isModified())                          if (m_FxSends[index.row()].isModified())
76                                  return QIcon(":/icons/formEdit.png");                                  return QIcon(":/images/formEdit.png");
77                          return QIcon(":/icons/itemFile.png");                          return QIcon(":/images/itemFile.png");
78                  case Qt::FontRole: {                  case Qt::FontRole: {
79                          if (m_FxSends[index.row()].isModified()) {                          if (m_FxSends[index.row()].isModified()) {
80                                  QFont font;                                  QFont font;
# Line 120  FxSend* FxSendsModel::addFxSend() { Line 121  FxSend* FxSendsModel::addFxSend() {
121          fxSend.setName("New FX Send");          fxSend.setName("New FX Send");
122          m_FxSends.push_back(fxSend);          m_FxSends.push_back(fxSend);
123          QModelIndex index = createIndex(m_FxSends.size() - 1, 0);          QModelIndex index = createIndex(m_FxSends.size() - 1, 0);
124    #if QT_VERSION < 0x050000
125          QAbstractListModel::reset();          QAbstractListModel::reset();
126    #else
127            QAbstractListModel::beginResetModel();
128            QAbstractListModel::endResetModel();
129    #endif
130          emit fxSendsDirtyChanged(true);          emit fxSendsDirtyChanged(true);
131          return &m_FxSends.last();          return &m_FxSends.last();
132  #else // CONFIG_FXSEND  #else // CONFIG_FXSEND
# Line 139  void FxSendsModel::removeFxSend(const QM Line 145  void FxSendsModel::removeFxSend(const QM
145          FxSend* pFxSend = fxSend(index);          FxSend* pFxSend = fxSend(index);
146          if (!pFxSend) return;          if (!pFxSend) return;
147          pFxSend->setDeletion(true);          pFxSend->setDeletion(true);
148    #if QT_VERSION < 0x050000
149          QAbstractListModel::reset();          QAbstractListModel::reset();
150    #else
151            QAbstractListModel::beginResetModel();
152            QAbstractListModel::endResetModel();
153    #endif
154          emit fxSendsDirtyChanged(true);          emit fxSendsDirtyChanged(true);
155  }  }
156    
# Line 152  void FxSendsModel::cleanRefresh() { Line 163  void FxSendsModel::cleanRefresh() {
163                  fxSend.getFromSampler();                  fxSend.getFromSampler();
164                  m_FxSends.push_back(fxSend);                  m_FxSends.push_back(fxSend);
165          }          }
166    #if QT_VERSION < 0x050000
167          QAbstractListModel::reset();          QAbstractListModel::reset();
168    #else
169            QAbstractListModel::beginResetModel();
170            QAbstractListModel::endResetModel();
171    #endif
172          emit fxSendsDirtyChanged(false);          emit fxSendsDirtyChanged(false);
173  }  }
174    

Legend:
Removed from v.1668  
changed lines
  Added in v.2387

  ViewVC Help
Powered by ViewVC