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
200f8476
Commit
200f8476
authored
May 28, 2020
by
Jean-Baptiste Mardelle
Browse files
Reset current project name if opening backup file fails to prevent erasing original
Related to #705
parent
486ce549
Pipeline
#21520
passed with stage
in 20 minutes and 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/mainwindow.cpp
View file @
200f8476
...
...
@@ -2245,7 +2245,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 @
200f8476
...
...
@@ -539,6 +539,7 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
}
else
if
(
KdenliveSettings
::
audio_channels
()
==
2
)
{
audioChannels
=
6
;
}
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
>
(),
...
...
@@ -551,13 +552,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"
));
...
...
@@ -636,8 +639,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