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
34040707
Commit
34040707
authored
Sep 23, 2021
by
Jean-Baptiste Mardelle
Browse files
Ensure we always use UTF-8 enconding when writing files
parent
85dfe0a0
Changes
10
Hide whitespace changes
Inline
Side-by-side
src/bin/bin.cpp
View file @
34040707
...
...
@@ -1556,6 +1556,7 @@ void Bin::slotReloadClip()
KMessageBox
::
sorry
(
this
,
i18n
(
"Unable to write to file %1"
,
path
));
}
else
{
QTextStream
out
(
&
f
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
f
.
close
();
KMessageBox
::
information
(
...
...
@@ -1859,6 +1860,7 @@ void Bin::createClip(const QDomElement &xml)
KMessageBox
::
sorry
(
this
,
i18n
(
"Unable to write to file %1"
,
path
));
}
else
{
QTextStream
out
(
&
f
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
f
.
close
();
KMessageBox
::
information
(
...
...
src/dialogs/renderwidget.cpp
View file @
34040707
...
...
@@ -735,6 +735,7 @@ bool RenderWidget::saveProfile(QDomElement newprofile)
return
false
;
}
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
if
(
file
.
error
()
!=
QFile
::
NoError
)
{
KMessageBox
::
error
(
this
,
i18n
(
"Cannot write to file %1"
,
dir
.
absoluteFilePath
(
"customprofiles.xml"
)));
...
...
@@ -954,6 +955,7 @@ void RenderWidget::slotEditProfile()
return
;
}
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
if
(
file
.
error
()
!=
QFile
::
NoError
)
{
KMessageBox
::
error
(
this
,
i18n
(
"Cannot write to file %1"
,
exportFile
));
...
...
@@ -1010,6 +1012,7 @@ void RenderWidget::slotDeleteProfile(bool dontRefresh)
return
;
}
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
if
(
file
.
error
()
!=
QFile
::
NoError
)
{
KMessageBox
::
error
(
this
,
i18n
(
"Cannot write to file %1"
,
exportFile
));
...
...
@@ -2268,6 +2271,7 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
return
;
}
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
newdoc
.
toString
();
file
.
close
();
parseFile
(
exportFile
,
editable
);
...
...
@@ -2917,6 +2921,7 @@ bool RenderWidget::startWaitingRenderJobs()
}
QTextStream
outStream
(
&
file
);
outStream
.
setCodec
(
"UTF-8"
);
#ifndef Q_OS_WIN
outStream
<<
"#!/bin/sh
\n\n
"
;
#endif
...
...
src/doc/documentvalidator.cpp
View file @
34040707
...
...
@@ -1814,6 +1814,7 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
if
(
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Truncate
))
{
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
}
file
.
close
();
...
...
src/doc/kdenlivedoc.cpp
View file @
34040707
...
...
@@ -928,6 +928,7 @@ void KdenliveDoc::saveCustomEffects(const QDomNodeList &customeffects)
QFile
file
(
path
);
if
(
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Truncate
))
{
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
}
}
...
...
src/effects/effectlist/model/effecttreemodel.cpp
View file @
34040707
...
...
@@ -243,6 +243,7 @@ void EffectTreeModel::editCustomAsset(const QString newName,const QString newDes
if
(
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Truncate
))
{
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
}
file
.
close
();
...
...
@@ -256,6 +257,7 @@ void EffectTreeModel::editCustomAsset(const QString newName,const QString newDes
QFile
file
(
dir
.
absoluteFilePath
(
currentName
+
QStringLiteral
(
".xml"
)));
if
(
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Truncate
))
{
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
}
file
.
close
();
...
...
src/effects/effectsrepository.cpp
View file @
34040707
...
...
@@ -369,6 +369,7 @@ QPair <QString, QString> EffectsRepository::fixCustomAssetFile(const QString &pa
}
if
(
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Truncate
))
{
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
}
file
.
close
();
...
...
src/effects/effectstack/view/collapsibleeffectview.cpp
View file @
34040707
...
...
@@ -551,6 +551,7 @@ void CollapsibleEffectView::slotSaveEffect()
if
(
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Truncate
))
{
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
}
file
.
close
();
...
...
src/effects/effectstack/view/effectstackview.cpp
View file @
34040707
...
...
@@ -497,6 +497,7 @@ void EffectStackView::slotSaveStack()
QFile
file
(
dir
.
absoluteFilePath
(
name
+
QStringLiteral
(
".xml"
)));
if
(
file
.
open
(
QFile
::
WriteOnly
|
QFile
::
Truncate
))
{
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
}
file
.
close
();
...
...
src/jobs/proxytask.cpp
View file @
34040707
...
...
@@ -89,6 +89,7 @@ void ProxyTask::run()
if
(
playlist
->
open
())
{
source
=
playlist
->
fileName
();
QTextStream
out
(
playlist
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
playlist
->
close
();
}
...
...
src/project/projectmanager.cpp
View file @
34040707
...
...
@@ -1173,6 +1173,7 @@ void ProjectManager::saveWithUpdatedProfile(const QString &updatedProfile)
return
;
}
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
<<
doc
.
toString
();
if
(
file
.
error
()
!=
QFile
::
NoError
)
{
KMessageBox
::
error
(
qApp
->
activeWindow
(),
i18n
(
"Cannot write to file %1"
,
convertedFile
));
...
...
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