Skip to content
GitLab
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
9fee60cd
Commit
9fee60cd
authored
Nov 09, 2022
by
Jean-Baptiste Mardelle
Browse files
fix crash on document open.
Related to
#1571
parent
bdd6a8dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/doc/kdenlivedoc.cpp
View file @
9fee60cd
...
...
@@ -370,10 +370,11 @@ void KdenliveDoc::initializeProperties(bool newDocument)
}
}
const
QStringList
KdenliveDoc
::
guidesCategories
()
const
const
QStringList
KdenliveDoc
::
guidesCategories
()
{
if
(
!
m_documentProperties
.
contains
(
QStringLiteral
(
"guidesCategories"
))
||
m_documentProperties
.
value
(
QStringLiteral
(
"guidesCategories"
)).
isEmpty
())
{
return
getDefaultGuideCategories
();
const
QString
defaultCategories
=
getDefaultGuideCategories
().
join
(
QLatin1Char
(
'\n'
));
m_documentProperties
[
QStringLiteral
(
"guidesCategories"
)]
=
defaultCategories
;
}
return
m_documentProperties
.
value
(
QStringLiteral
(
"guidesCategories"
)).
split
(
QLatin1Char
(
'\n'
));
}
...
...
@@ -1548,8 +1549,7 @@ void KdenliveDoc::loadDocumentProperties()
if
(
!
profileFound
)
{
qDebug
()
<<
"ERROR, no matching profile found"
;
}
const
QStringList
guideCategories
=
m_documentProperties
.
value
(
QStringLiteral
(
"guidesCategories"
)).
split
(
QLatin1Char
(
'\n'
));
m_guideModel
->
loadCategories
(
guideCategories
);
m_guideModel
->
loadCategories
(
guidesCategories
());
updateProjectProfile
(
false
);
}
...
...
src/doc/kdenlivedoc.h
View file @
9fee60cd
...
...
@@ -216,7 +216,7 @@ public:
/** @brief Ensure we don't have leftover preview chunks (created after last save */
void
cleanupTimelinePreview
(
const
QDateTime
&
documentDate
);
/** @brief Returns the guides categories for the project in format {name:index:#color} */
const
QStringList
guidesCategories
()
const
;
const
QStringList
guidesCategories
();
/** @brief Set the guides categories for the project in format {name:index:#color} */
void
updateGuideCategories
(
const
QStringList
&
categories
,
const
QMap
<
int
,
int
>
remapCategories
=
{});
/** @brief Setup a filter to visible guides */
...
...
src/project/dialogs/guideslist.cpp
View file @
9fee60cd
...
...
@@ -339,6 +339,10 @@ void GuidesList::setModel(std::weak_ptr<MarkerListModel> model, std::shared_ptr<
void
GuidesList
::
rebuildCategories
()
{
if
(
pCore
->
markerTypes
.
isEmpty
())
{
// Categories are not ready, abort
return
;
}
QPixmap
pixmap
(
32
,
32
);
// Cleanup default marker category menu
QMenu
*
markerDefaultMenu
=
default_category
->
menu
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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