filtercontroller.cpp (shotcut-22.10.22) | : | filtercontroller.cpp (shotcut-22.11.25) | ||
---|---|---|---|---|
skipping to change at line 182 | skipping to change at line 182 | |||
} | } | |||
QmlMetadata *meta = m_attachedModel.getMetadata(m_currentFilterIndex); | QmlMetadata *meta = m_attachedModel.getMetadata(m_currentFilterIndex); | |||
QmlFilter *filter = 0; | QmlFilter *filter = 0; | |||
if (meta) { | if (meta) { | |||
emit currentFilterChanged(nullptr, nullptr, QmlFilter::NoCurrentFilter); | emit currentFilterChanged(nullptr, nullptr, QmlFilter::NoCurrentFilter); | |||
m_mltService = m_attachedModel.getService(m_currentFilterIndex); | m_mltService = m_attachedModel.getService(m_currentFilterIndex); | |||
if (!m_mltService) return; | if (!m_mltService) return; | |||
filter = new QmlFilter(*m_mltService, meta); | filter = new QmlFilter(*m_mltService, meta); | |||
filter->setIsNew(isNew); | filter->setIsNew(isNew); | |||
connect(filter, SIGNAL(changed()), SLOT(onQmlFilterChanged())); | ||||
connect(filter, SIGNAL(changed(QString)), SLOT(onQmlFilterChanged(const QString &))); | connect(filter, SIGNAL(changed(QString)), SLOT(onQmlFilterChanged(const QString &))); | |||
} | } | |||
emit currentFilterChanged(filter, meta, m_currentFilterIndex); | emit currentFilterChanged(filter, meta, m_currentFilterIndex); | |||
m_currentFilter.reset(filter); | m_currentFilter.reset(filter); | |||
} | } | |||
void FilterController::onFadeInChanged() | void FilterController::onFadeInChanged() | |||
{ | { | |||
if (m_currentFilter) { | if (m_currentFilter) { | |||
skipping to change at line 253 | skipping to change at line 252 | |||
setCurrentFilter(qBound(0, first, m_attachedModel.rowCount() - 1), true); | setCurrentFilter(qBound(0, first, m_attachedModel.rowCount() - 1), true); | |||
} | } | |||
void FilterController::handleAttachDuplicateFailed(int index) | void FilterController::handleAttachDuplicateFailed(int index) | |||
{ | { | |||
const QmlMetadata *meta = m_attachedModel.getMetadata(index); | const QmlMetadata *meta = m_attachedModel.getMetadata(index); | |||
emit statusChanged(tr("Only one %1 filter is allowed.").arg(meta->name())); | emit statusChanged(tr("Only one %1 filter is allowed.").arg(meta->name())); | |||
setCurrentFilter(index); | setCurrentFilter(index); | |||
} | } | |||
void FilterController::onQmlFilterChanged() | ||||
{ | ||||
emit filterChanged(m_mltService); | ||||
} | ||||
void FilterController::onQmlFilterChanged(const QString &name) | void FilterController::onQmlFilterChanged(const QString &name) | |||
{ | { | |||
if (name == "disable") { | if (name == "disable") { | |||
QModelIndex index = m_attachedModel.index(m_currentFilterIndex); | QModelIndex index = m_attachedModel.index(m_currentFilterIndex); | |||
emit m_attachedModel.dataChanged(index, index, QVector<int>() << Qt::Che ckStateRole); | emit m_attachedModel.dataChanged(index, index, QVector<int>() << Qt::Che ckStateRole); | |||
} | } | |||
emit filterChanged(m_mltService); | ||||
} | } | |||
void FilterController::removeCurrent() | void FilterController::removeCurrent() | |||
{ | { | |||
if (m_currentFilterIndex > QmlFilter::NoCurrentFilter) | if (m_currentFilterIndex > QmlFilter::NoCurrentFilter) | |||
m_attachedModel.remove(m_currentFilterIndex); | m_attachedModel.remove(m_currentFilterIndex); | |||
} | } | |||
void FilterController::onProducerChanged() | void FilterController::onProducerChanged() | |||
{ | { | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 1 lines changed or added |