Add GIF to default image sequence render profiles

CCBUG: 357614
parent 595add20
......@@ -1763,21 +1763,38 @@ void RenderWidget::parseMltPresets()
}
QStringList profiles = root.entryList(QDir::Files, QDir::Name);
foreach(const QString &prof, profiles) {
KConfig config(root.absoluteFilePath(prof), KConfig::SimpleConfig );
KConfigGroup group = config.group(QByteArray());
QString extension = group.readEntry("meta.preset.extension");
QString note = group.readEntry("meta.preset.note");
QTreeWidgetItem *item = new QTreeWidgetItem(QStringList(prof));
item->setData(0, GroupRole, groupName);
item->setData(0, ExtensionRole, extension);
item->setData(0, RenderRole, "avformat");
QTreeWidgetItem *item = loadFromMltPreset(groupName, root.absoluteFilePath(prof), prof);
if (!item)
continue;
item->setData(0, ParamsRole, QString("properties=stills/" + prof));
if (!note.isEmpty()) item->setToolTip(0, note);
groupItem->addChild(item);
}
// Add GIF as image sequence
root.cdUp();
QTreeWidgetItem *item = loadFromMltPreset(groupName, root.absoluteFilePath(QStringLiteral("GIF")), QStringLiteral("GIF"));
if (item) {
item->setData(0, ParamsRole, QString("properties=GIF"));
groupItem->addChild(item);
}
}
}
QTreeWidgetItem *RenderWidget::loadFromMltPreset(const QString groupName, const QString path, const QString profileName)
{
KConfig config(path, KConfig::SimpleConfig);
KConfigGroup group = config.group(QByteArray());
QString extension = group.readEntry("meta.preset.extension");
QString note = group.readEntry("meta.preset.note");
if (extension.isEmpty())
return NULL;
QTreeWidgetItem *item = new QTreeWidgetItem(QStringList(profileName));
item->setData(0, GroupRole, groupName);
item->setData(0, ExtensionRole, extension);
item->setData(0, RenderRole, "avformat");
if (!note.isEmpty()) item->setToolTip(0, note);
return item;
}
void RenderWidget::parseFile(const QString &exportFile, bool editable)
{
QDomDocument doc;
......
......@@ -208,6 +208,8 @@ private:
void startRendering(RenderJobItem *item);
bool saveProfile(QDomElement newprofile);
void errorMessage(const QString &message);
/** @brief Create a rendering profile from MLT preset. */
QTreeWidgetItem *loadFromMltPreset(const QString groupName, const QString path, const QString profileName);
signals:
void abortProcess(const QString &url);
......
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