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
ea3031cd
Commit
ea3031cd
authored
Apr 03, 2021
by
Julius Künzel
Browse files
Backup subtitles too
FIxes
#942
parent
301cfeb8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/doc/kdenlivedoc.cpp
View file @
ea3031cd
...
...
@@ -1048,6 +1048,15 @@ void KdenliveDoc::backupLastSavedVersion(const QString &path)
if
(
!
QFile
::
copy
(
path
,
backupFile
))
{
KMessageBox
::
information
(
QApplication
::
activeWindow
(),
i18n
(
"Cannot create backup copy:
\n
%1"
,
backupFile
));
}
// backup subitle file in case we have one
QString
subpath
(
path
+
QStringLiteral
(
".srt"
));
QString
subbackupFile
(
backupFile
+
QStringLiteral
(
".srt"
));
if
(
QFile
(
subpath
).
exists
())
{
QFile
::
remove
(
subbackupFile
);
if
(
!
QFile
::
copy
(
subpath
,
subbackupFile
))
{
KMessageBox
::
information
(
QApplication
::
activeWindow
(),
i18n
(
"Cannot create backup copy:
\n
%1"
,
subbackupFile
));
}
}
}
}
...
...
@@ -1131,21 +1140,25 @@ void KdenliveDoc::cleanupBackupFiles()
f
=
hourList
.
takeFirst
();
QFile
::
remove
(
f
);
QFile
::
remove
(
f
+
QStringLiteral
(
".png"
));
QFile
::
remove
(
f
+
QStringLiteral
(
".srt"
));
}
while
(
dayList
.
count
()
>
0
)
{
f
=
dayList
.
takeFirst
();
QFile
::
remove
(
f
);
QFile
::
remove
(
f
+
QStringLiteral
(
".png"
));
QFile
::
remove
(
f
+
QStringLiteral
(
".srt"
));
}
while
(
weekList
.
count
()
>
0
)
{
f
=
weekList
.
takeFirst
();
QFile
::
remove
(
f
);
QFile
::
remove
(
f
+
QStringLiteral
(
".png"
));
QFile
::
remove
(
f
+
QStringLiteral
(
".srt"
));
}
while
(
oldList
.
count
()
>
0
)
{
f
=
oldList
.
takeFirst
();
QFile
::
remove
(
f
);
QFile
::
remove
(
f
+
QStringLiteral
(
".png"
));
QFile
::
remove
(
f
+
QStringLiteral
(
".srt"
));
}
}
...
...
src/project/projectmanager.cpp
View file @
ea3031cd
...
...
@@ -655,6 +655,7 @@ bool ProjectManager::slotOpenBackup(const QUrl &url)
if
(
m_project
)
{
if
(
!
m_project
->
url
().
isEmpty
())
{
// Only update if restore succeeded
pCore
->
window
()
->
slotEditSubtitle
();
m_project
->
setUrl
(
projectFile
);
m_project
->
setModified
(
true
);
}
...
...
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