Hide GPU effects/compositions when movit disabled

parent f4e90f6e
......@@ -22,6 +22,7 @@
#include "effecttreemodel.hpp"
#include "abstractmodel/treeitem.hpp"
#include "effects/effectsrepository.hpp"
#include "kdenlivesettings.h"
#include <KLocalizedString>
#include <QDomDocument>
#include <QFile>
......@@ -58,6 +59,9 @@ std::shared_ptr<EffectTreeModel> EffectTreeModel::construct(const QString &categ
for (int i = 0; i < groups.count(); i++) {
QString groupName = i18n(groups.at(i).firstChild().firstChild().nodeValue().toUtf8().constData());
if (!KdenliveSettings::gpu_accel() && groupName == i18n("GPU effects")) {
continue;
}
QStringList list = groups.at(i).toElement().attribute(QStringLiteral("list")).split(QLatin1Char(','), QString::SkipEmptyParts);
auto groupItem = self->rootItem->appendChild(QList<QVariant>{groupName, QStringLiteral("root")});
......@@ -75,6 +79,9 @@ std::shared_ptr<EffectTreeModel> EffectTreeModel::construct(const QString &categ
// We parse effects
auto allEffects = EffectsRepository::get()->getNames();
for (const auto &effect : allEffects) {
if (!KdenliveSettings::gpu_accel() && effect.first.contains(QLatin1String("movit."))) {
continue;
}
auto targetCategory = miscCategory;
EffectType type = EffectsRepository::get()->getType(effect.first);
if (effectCategory.contains(effect.first)) {
......
......@@ -21,6 +21,7 @@
#include "transitiontreemodel.hpp"
#include "abstractmodel/treeitem.hpp"
#include "kdenlivesettings.h"
#include "transitions/transitionsrepository.hpp"
#include <KLocalizedString>
......@@ -50,6 +51,10 @@ std::shared_ptr<TransitionTreeModel> TransitionTreeModel::construct(bool flat, Q
// We parse transitions
auto allTransitions = TransitionsRepository::get()->getNames();
for (const auto &transition : allTransitions) {
if (!KdenliveSettings::gpu_accel() && transition.first.contains(QLatin1String("movit."))) {
// Hide GPU compositions when movit disabled
continue;
}
std::shared_ptr<TreeItem> targetCategory = compoCategory;
TransitionType type = TransitionsRepository::get()->getType(transition.first);
if (type == TransitionType::AudioTransition || type == TransitionType::VideoTransition) {
......
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