Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
b46d9fe2
Commit
b46d9fe2
authored
May 05, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use safer QSaveFile class to ensure our document is not corrupted on disk full.
Fixes
#664
parent
fd453f88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
src/doc/kdenlivedoc.cpp
src/doc/kdenlivedoc.cpp
+5
-7
No files found.
src/doc/kdenlivedoc.cpp
View file @
b46d9fe2
...
...
@@ -612,22 +612,20 @@ bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene)
backupFile
));
}
}
QFile
file
(
path
);
Q
Save
File
file
(
path
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
{
qCWarning
(
KDENLIVE_LOG
)
<<
"////// ERROR writing to file: "
<<
path
;
KMessageBox
::
error
(
QApplication
::
activeWindow
(),
i18n
(
"Cannot write to file %1"
,
path
));
return
false
;
}
file
.
write
(
scene
List
.
toString
().
toUtf8
()
);
if
(
file
.
error
()
!=
QFile
::
NoError
)
{
const
QByteArray
sceneData
=
sceneList
.
toString
().
toUtf8
();
file
.
write
(
scene
Data
);
if
(
!
file
.
commit
()
)
{
KMessageBox
::
error
(
QApplication
::
activeWindow
(),
i18n
(
"Cannot write to file %1"
,
path
));
file
.
close
();
return
false
;
}
file
.
close
();
cleanupBackupFiles
();
QFileInfo
info
(
file
);
QFileInfo
info
(
path
);
QString
fileName
=
QUrl
::
fromLocalFile
(
path
).
fileName
().
section
(
QLatin1Char
(
'.'
),
0
,
-
2
);
fileName
.
append
(
QLatin1Char
(
'-'
)
+
m_documentProperties
.
value
(
QStringLiteral
(
"documentid"
)));
fileName
.
append
(
info
.
lastModified
().
toString
(
QStringLiteral
(
"-yyyy-MM-dd-hh-mm"
)));
...
...
Write
Preview
Markdown
is supported
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