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
7c6e28ea
Commit
7c6e28ea
authored
May 28, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset current project name if opening backup file fails to prevent erasing original
Related to
#705
parent
0ec23620
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
src/mainwindow.cpp
src/mainwindow.cpp
+0
-1
src/project/projectmanager.cpp
src/project/projectmanager.cpp
+11
-5
No files found.
src/mainwindow.cpp
View file @
7c6e28ea
...
...
@@ -2231,7 +2231,6 @@ void MainWindow::connectDocument()
}
m_zoomSlider
->
setValue
(
project
->
zoom
().
x
());
m_commandStack
->
setActiveStack
(
project
->
commandStack
().
get
());
setWindowTitle
(
project
->
description
());
setWindowModified
(
project
->
isModified
());
m_saveAction
->
setEnabled
(
project
->
isModified
());
...
...
src/project/projectmanager.cpp
View file @
7c6e28ea
...
...
@@ -516,6 +516,7 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
m_progressDialog
->
show
();
bool
openBackup
;
m_notesPlugin
->
clear
();
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
stale
?
QUrl
::
fromLocalFile
(
stale
->
fileName
())
:
url
,
QString
(),
pCore
->
window
()
->
m_commandStack
,
KdenliveSettings
::
default_profile
().
isEmpty
()
?
pCore
->
getCurrentProfile
()
->
path
()
:
KdenliveSettings
::
default_profile
(),
QMap
<
QString
,
QString
>
(),
QMap
<
QString
,
QString
>
(),
...
...
@@ -528,13 +529,15 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
}
else
{
doc
->
m_autosave
=
stale
;
stale
->
setParent
(
doc
);
// if loading from an autosave of unnamed file then keep unnamed
// if loading from an autosave of unnamed file, or restor failed then keep unnamed
bool
loadingFailed
=
doc
->
url
().
isEmpty
();
if
(
url
.
fileName
().
contains
(
QStringLiteral
(
"_untitled.kdenlive"
)))
{
doc
->
setUrl
(
QUrl
());
}
else
{
doc
->
setModified
(
true
);
}
else
if
(
!
loadingFailed
)
{
doc
->
setUrl
(
url
);
}
doc
->
setModified
(
true
);
doc
->
setModified
(
!
loadingFailed
);
stale
->
setParent
(
doc
);
}
m_progressDialog
->
setLabelText
(
i18n
(
"Loading clips"
));
...
...
@@ -613,8 +616,11 @@ bool ProjectManager::slotOpenBackup(const QUrl &url)
closeCurrentDocument
(
false
);
doOpenFile
(
QUrl
::
fromLocalFile
(
requestedBackup
),
nullptr
);
if
(
m_project
)
{
m_project
->
setUrl
(
projectFile
);
m_project
->
setModified
(
true
);
if
(
!
m_project
->
url
().
isEmpty
())
{
// Only update if restore succeeded
m_project
->
setUrl
(
projectFile
);
m_project
->
setModified
(
true
);
}
pCore
->
window
()
->
setWindowTitle
(
m_project
->
description
());
result
=
true
;
}
...
...
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