HistoryModel::HistoryModel(HistoryManager *history, QObject *parent) : QAbstractTableModel(parent) , m_history(history) { Q_ASSERT(m_history); connect(m_history, SIGNAL(historyReset()), this, SLOT(historyReset())); connect(m_history, SIGNAL(entryRemoved(const HistoryEntry &)), this, SLOT(historyReset())); connect(m_history, SIGNAL(entryAdded(const HistoryEntry &)), this, SLOT(entryAdded())); connect(m_history, SIGNAL(entryUpdated(int)), this, SLOT(entryUpdated(int))); }
bool HistoryModel::removeRows(int row, int count, const QModelIndex &parent) { if (parent.isValid()) return false; int lastRow = row + count - 1; beginRemoveRows(parent, row, lastRow); QList<HistoryEntry> lst = m_history->history(); for (int i = lastRow; i >= row; --i) lst.removeAt(i); disconnect(m_history, SIGNAL(historyReset()), this, SLOT(historyReset())); m_history->setHistory(lst); connect(m_history, SIGNAL(historyReset()), this, SLOT(historyReset())); endRemoveRows(); return true; }
void HistoryManager::clear() { m_history.clear(); m_lastSavedUrl = QString(); m_saveTimer->changeOccurred(); m_saveTimer->saveIfNeccessary(); historyReset(); }
void HistoryManager::clear() { m_history.clear(); m_atomicStringHash.clear(); m_lastSavedUrl.clear(); m_saveTimer->changeOccurred(); m_saveTimer->saveIfNeccessary(); emit historyReset(); emit historyCleared(); }
void HistoryManager::setHistory(const QList<HistoryItem> &history, bool loadedAndSorted) { m_history = history; // verify that it is sorted by date if (!loadedAndSorted) qSort(m_history.begin(), m_history.end()); checkForExpired(); if (loadedAndSorted) { m_lastSavedUrl = m_history.value(0).url; } else { m_lastSavedUrl = QString(); m_saveTimer->changeOccurred(); } emit historyReset(); }
KVFModel::KVFModel(MeshModel* model) : lastVFCalcTime(0), MeshModel(*model), L2(NULL), L1(NULL), lastDispsSize(0), P(CholmodSparseMatrix::ASSYMETRIC), Pcopy(CholmodSparseMatrix::ASSYMETRIC) { faces = model->faces; boundaryVertices = model->boundaryVertices; initialVertexes = model->vertices; vf = new Point2[getNumVertices()]; vfOrig = new Point2[getNumVertices()]; newPoints.resize(getNumVertices()); counts.resize(getNumVertices()); historyReset(); }