Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
695c6b3b
Commit
695c6b3b
authored
Oct 11, 2020
by
Vivek Yadav
Committed by
Jean-Baptiste Mardelle
Oct 18, 2020
Browse files
Update effecttreemodel.cpp
parent
ec97c564
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/effects/effectlist/model/effecttreemodel.cpp
View file @
695c6b3b
...
...
@@ -214,16 +214,16 @@ void EffectTreeModel::editCustomAsset(const QString newName,const QString newDes
if
(
!
newDescription
.
trimmed
().
isEmpty
()){
QDomElement
root
=
doc
.
documentElement
();
QDomElement
nodelist
=
root
.
firstChildElement
(
"description"
);
QDomElement
newNodeTag
=
doc
.
createElement
(
QString
(
"description"
));
QDomText
text
=
doc
.
createTextNode
(
newDescription
);
newNodeTag
.
appendChild
(
text
);
root
.
replaceChild
(
newNodeTag
,
nodelist
);
QDomElement
root
=
doc
.
documentElement
();
QDomElement
nodelist
=
root
.
firstChildElement
(
"description"
);
QDomElement
newNodeTag
=
doc
.
createElement
(
QString
(
"description"
));
QDomText
text
=
doc
.
createTextNode
(
newDescription
);
newNodeTag
.
appendChild
(
text
);
root
.
replaceChild
(
newNodeTag
,
nodelist
);
}
}
if
(
!
newName
.
trimmed
().
isEmpty
())
if
(
!
newName
.
trimmed
().
isEmpty
()
&&
newName
!=
currentName
)
{
QDir
dir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppDataLocation
)
+
QStringLiteral
(
"/effects/"
));
if
(
!
dir
.
exists
())
{
...
...
@@ -249,24 +249,24 @@ void EffectTreeModel::editCustomAsset(const QString newName,const QString newDes
e
.
setAttribute
(
"id"
,
newName
);
if
(
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Truncate
))
{
QTextStream
out
(
&
file
);
out
<<
doc
.
toString
();
}
file
.
close
();
QTextStream
out
(
&
file
);
out
<<
doc
.
toString
();
}
file
.
close
();
deleteEffect
(
index
);
reloadEffect
(
dir
.
absoluteFilePath
(
newName
+
QStringLiteral
(
".xml"
)));
deleteEffect
(
index
);
reloadEffect
(
dir
.
absoluteFilePath
(
newName
+
QStringLiteral
(
".xml"
)));
}
else
{
QFile
file
(
dir
.
absoluteFilePath
(
currentName
+
QStringLiteral
(
".xml"
)));
if
(
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Truncate
))
{
QTextStream
out
(
&
file
);
out
<<
doc
.
toString
();
}
file
.
close
();
reloadEffect
(
oldpath
);
QTextStream
out
(
&
file
);
out
<<
doc
.
toString
();
}
file
.
close
();
reloadEffect
(
oldpath
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment