Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Some cleanup and move blacklist files in a Qt resource to prevent conflicts...

Some cleanup and move blacklist files in a Qt resource to prevent conflicts between different Kdenlive versions
parent c122e8c9
......@@ -29,7 +29,6 @@ BoolParamWidget::BoolParamWidget(std::shared_ptr<AssetParameterModel> model, QMo
// setup the comment
QString name = m_model->data(m_index, AssetParameterModel::NameRole).toString();
bool checked = m_model->data(m_index, AssetParameterModel::ValueRole).toInt();
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
setToolTip(comment);
m_labelComment->setText(comment);
......@@ -39,7 +38,7 @@ BoolParamWidget::BoolParamWidget(std::shared_ptr<AssetParameterModel> model, QMo
m_labelName->setText(m_model->data(m_index, Qt::DisplayRole).toString());
// set check state
m_checkBox->setChecked(checked);
slotRefresh();
// emit the signal of the base class when appropriate
connect(this->m_checkBox, &QCheckBox::stateChanged, [this](int) { emit valueChanged(m_index, QString::number(m_checkBox->isChecked()), true); });
......
......@@ -34,23 +34,18 @@ PositionEditWidget::PositionEditWidget(std::shared_ptr<AssetParameterModel> mode
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
//TODO: take absolute from effect data
m_absolute = false;
int value = m_model->data(m_index, AssetParameterModel::ValueRole).toInt();
int min = m_model->data(m_index, AssetParameterModel::ParentInRole).toInt();
int max = min + m_model->data(m_index, AssetParameterModel::ParentDurationRole).toInt();
QLabel *label = new QLabel(name, this);
m_slider = new QSlider(Qt::Horizontal, this);
m_slider->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred));
m_display = new TimecodeDisplay(pCore->monitorManager()->timecode(), this);
m_display->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred));
slotSetRange(QPair<int, int>(min, max));
layout->addWidget(label);
layout->addWidget(m_slider);
layout->addWidget(m_display);
slotRefresh();
m_slider->setValue(value);
m_display->setValue(value);
connect(m_slider, &QAbstractSlider::valueChanged, m_display, static_cast<void (TimecodeDisplay::*)(int)>(&TimecodeDisplay::setValue));
connect(m_slider, &QAbstractSlider::valueChanged, this, &PositionEditWidget::valueChanged);
......
......@@ -138,7 +138,7 @@ void EffectsRepository::parseType(QScopedPointer<Mlt::Properties> &metadata, Inf
QString EffectsRepository::assetBlackListPath() const
{
return QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("blacklisted_effects.txt"));
return QStringLiteral(":data/blacklisted_effects.txt");
}
Mlt::Filter *EffectsRepository::getEffect(const QString &effectId) const
......
......@@ -228,7 +228,7 @@ bool initEffects::parseEffectFiles(std::unique_ptr<Mlt::Repository> &repository,
}
// Remove blacklisted transitions from the list.
QFile file(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("blacklisted_transitions.txt")));
QFile file(QStringLiteral(":data/blacklisted_transitions.txt"));
if (file.open(QIODevice::ReadOnly)) {
QTextStream in(&file);
while (!in.atEnd()) {
......@@ -246,7 +246,7 @@ bool initEffects::parseEffectFiles(std::unique_ptr<Mlt::Repository> &repository,
// Remove blacklisted effects from the filters list.
QStringList mltFiltersList = filtersList;
QStringList mltBlackList;
QFile file2(QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("blacklisted_effects.txt")));
QFile file2(QStringLiteral(":data/blacklisted_effects.txt"));
if (file2.open(QIODevice::ReadOnly)) {
QTextStream in(&file2);
while (!in.atEnd()) {
......
......@@ -123,7 +123,7 @@ QSet<QString> TransitionsRepository::getSingleTrackTransitions()
QString TransitionsRepository::assetBlackListPath() const
{
return QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("blacklisted_transitions.txt"));
return QStringLiteral(":data/blacklisted_transitions.txt");
}
Mlt::Transition *TransitionsRepository::getTransition(const QString &transitionId) const
......
......@@ -33,4 +33,8 @@
<file alias="EffectSlider.qml">effects/effectstack/view/qml/EffectSlider.qml</file>
<file alias="LiftGammaGain.qml">effects/effectstack/view/qml/LiftGammaGain.qml</file>
</qresource>
<qresource prefix="data">
<file alias="blacklisted_effects.txt">../data/blacklisted_effects.txt</file>
<file alias="blacklisted_transitions.txt">../data/blacklisted_transitions.txt</file>
</qresource>
</RCC>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment