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
e628768b
Commit
e628768b
authored
Jul 04, 2021
by
Julius Künzel
Browse files
Enable "save temporary files next to project file" for new projects too
Related to
#1106
parent
cba0ddbc
Pipeline
#68535
passed with stage
in 8 minutes and 24 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/doc/kdenlivedoc.h
View file @
e628768b
...
...
@@ -72,6 +72,8 @@ public:
QUrl
url
()
const
;
QUuid
uuid
;
KAutoSaveFile
*
m_autosave
;
/** @brief Whether the project folder should be in the same folder as the project file (var is only used for new projects)*/
bool
m_sameProjectFolder
;
Timecode
timecode
()
const
;
std
::
shared_ptr
<
DocUndoStack
>
commandStack
();
...
...
src/project/dialogs/projectsettings.cpp
View file @
e628768b
...
...
@@ -161,12 +161,6 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap<QString, QString> metada
custom_folder
->
setChecked
(
KdenliveSettings
::
customprojectfolder
());
project_folder
->
setUrl
(
QUrl
::
fromLocalFile
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
CacheLocation
)));
same_folder
->
setChecked
(
KdenliveSettings
::
sameprojectfolder
());
/* creating a new project we can't use the same folder option as we don't know the path of the project yet.
* If the the option is enabled in the default projec settings, we have disable the custom folder option
* and move the files to the new location as soon as the project is saved for the first time
*/
same_folder
->
setEnabled
(
false
);
custom_folder
->
setEnabled
(
!
KdenliveSettings
::
sameprojectfolder
());
}
// Select profile
...
...
src/project/projectmanager.cpp
View file @
e628768b
...
...
@@ -159,6 +159,7 @@ void ProjectManager::newFile(QString profileName, bool showProjectSettings)
pCore
->
monitorManager
()
->
resetDisplay
();
QString
documentId
=
QString
::
number
(
QDateTime
::
currentMSecsSinceEpoch
());
documentProperties
.
insert
(
QStringLiteral
(
"documentid"
),
documentId
);
bool
sameProjectFolder
=
KdenliveSettings
::
sameprojectfolder
();
if
(
!
showProjectSettings
)
{
if
(
!
closeCurrentDocument
())
{
return
;
...
...
@@ -210,6 +211,7 @@ void ProjectManager::newFile(QString profileName, bool showProjectSettings)
}
documentProperties
.
insert
(
QStringLiteral
(
"storagefolder"
),
projectFolder
+
documentId
);
}
sameProjectFolder
=
w
->
docFolderAsStorageFolder
();
documentMetadata
=
w
->
metadata
();
delete
w
;
}
...
...
@@ -218,6 +220,7 @@ void ProjectManager::newFile(QString profileName, bool showProjectSettings)
pCore
->
bin
()
->
cleanDocument
();
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
QUrl
(),
projectFolder
,
pCore
->
window
()
->
m_commandStack
,
profileName
,
documentProperties
,
documentMetadata
,
projectTracks
,
audioChannels
,
&
openBackup
,
pCore
->
window
());
doc
->
m_autosave
=
new
KAutoSaveFile
(
startFile
,
doc
);
doc
->
m_sameProjectFolder
=
sameProjectFolder
;
ThumbnailCache
::
get
()
->
clearCache
();
pCore
->
bin
()
->
setDocument
(
doc
);
m_project
=
doc
;
...
...
@@ -352,7 +355,7 @@ bool ProjectManager::saveFileAs(const QString &outputFileName, bool saveACopy)
m_fileRevert
->
setEnabled
(
true
);
pCore
->
window
()
->
m_undoView
->
stack
()
->
setClean
();
QString
newProjectFolder
(
saveFolder
+
QStringLiteral
(
"/cachefiles"
));
if
(((
oldProjectFolder
.
isEmpty
()
&&
KdenliveSettings
::
same
p
roject
f
older
()
)
||
m_project
->
projectTempFolder
()
==
oldProjectFolder
)
&&
newProjectFolder
!=
m_project
->
projectTempFolder
())
{
if
(((
oldProjectFolder
.
isEmpty
()
&&
m_project
->
m_
same
P
roject
F
older
)
||
m_project
->
projectTempFolder
()
==
oldProjectFolder
)
&&
newProjectFolder
!=
m_project
->
projectTempFolder
())
{
KMessageBox
::
ButtonCode
answer
=
KMessageBox
::
warningContinueCancel
(
pCore
->
window
(),
i18n
(
"The location of the project file changed. You selected to use the location of the project file to save temporary files. "
"This will move all temporary files from <b>%1</b> to <b>%2</b>, the project file will then be reloaded"
,
...
...
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