Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
65718c64
Unverified
Commit
65718c64
authored
Apr 17, 2024
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix updating index for change in value in category
parent
6e30365f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
changelog
+3
-0
src/category.cpp
+2
-3
src/model.cpp
+14
-0
No files found.
changelog
View file @
65718c64
Version
7.0.5
-
Fix
case
where
category
index
was
not
updated
for
updated
value
Version
7.0.4
Version
7.0.4
-
Do
not
install
headers
and
library
in
case
we
're not the top project
-
Do
not
install
headers
and
library
in
case
we
're not the top project
...
...
src/category.cpp
View file @
65718c64
...
@@ -1321,7 +1321,7 @@ void category::update_value(const std::vector<row_handle> &rows, std::string_vie
...
@@ -1321,7 +1321,7 @@ void category::update_value(const std::vector<row_handle> &rows, std::string_vie
std
::
string
oldValue
{
parent
[
item_name
].
text
()
};
std
::
string
oldValue
{
parent
[
item_name
].
text
()
};
std
::
string
value
{
value_provider
(
oldValue
)
};
std
::
string
value
{
value_provider
(
oldValue
)
};
parent
.
assign
(
colIx
,
valu
e
,
false
);
update_value
(
parent
.
get_row
(),
colIx
,
value
,
fals
e
,
false
);
for
(
auto
&&
[
childCat
,
linked
]
:
m_child_links
)
for
(
auto
&&
[
childCat
,
linked
]
:
m_child_links
)
{
{
...
@@ -1444,8 +1444,7 @@ void category::update_value(row *row, uint16_t item, std::string_view value, boo
...
@@ -1444,8 +1444,7 @@ void category::update_value(row *row, uint16_t item, std::string_view value, boo
// before updating
// before updating
bool
reinsert
=
false
;
bool
reinsert
=
false
;
if
(
updateLinked
and
// an update of an Item's value
if
(
m_index
!=
nullptr
and
key_item_indices
().
count
(
item
))
m_index
!=
nullptr
and
key_item_indices
().
count
(
item
))
{
{
reinsert
=
m_index
->
find
(
*
this
,
row
);
reinsert
=
m_index
->
find
(
*
this
,
row
);
if
(
reinsert
)
if
(
reinsert
)
...
...
src/model.cpp
View file @
65718c64
...
@@ -2725,8 +2725,22 @@ void structure::cleanup_empty_categories()
...
@@ -2725,8 +2725,22 @@ void structure::cleanup_empty_categories()
obsoleteEntities
.
push_back
(
entity
);
obsoleteEntities
.
push_back
(
entity
);
}
}
auto
validator
=
m_db
.
get_validator
();
for
(
auto
entity
:
obsoleteEntities
)
for
(
auto
entity
:
obsoleteEntities
)
{
std
::
string
entityID
=
entity
[
"id"
].
as
<
std
::
string
>
();
if
(
validator
)
{
for
(
auto
linked
:
validator
->
get_links_for_parent
(
"entity"
))
{
if
(
auto
cat
=
m_db
.
get
(
linked
->
m_child_category
))
cat
->
erase
(
cif
::
key
(
linked
->
m_child_keys
.
front
())
==
entityID
);
}
}
entities
.
erase
(
entity
);
entities
.
erase
(
entity
);
}
// the rest?
// the rest?
...
...
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