Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
GNOME Contacts
Commits
0aef494e
Commit
0aef494e
authored
Apr 25, 2018
by
Niels De Graef
😁
Browse files
ContactSheet: solve Critical with an empty first persona.
parent
86a648f4
Pipeline
#10940
passed with stage
in 13 minutes and 52 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/contacts-contact-sheet.vala
View file @
0aef494e
...
...
@@ -112,11 +112,11 @@ public class Contacts.ContactSheet : ContactForm {
create_name_label
();
this
.
last_row
+=
3
;
// Name/Avatar takes up 3 rows
bool
is_first_persona
=
true
;
var
personas
=
this
.
contact
.
get_personas_for_display
();
/* Cause personas are sorted properly I can do this */
foreach
(
var
p
in
personas
)
{
bool
is_first_persona
=
(
this
.
last_row
==
3
);
int
persona_store_pos
=
this
.
last_row
;
if
(!
is_first_persona
)
{
this
.
container_grid
.
attach
(
create_persona_store_label
(
p
),
0
,
this
.
last_row
,
3
);
...
...
@@ -126,12 +126,12 @@ public class Contacts.ContactSheet : ContactForm {
foreach
(
var
prop
in
ContactForm
.
SORTED_PROPERTIES
)
add_row_for_property
(
p
,
prop
);
if
(
this
.
last_row
!=
3
)
is_first_persona
=
false
;
// Nothing to show in the persona: don't mention it
if
(
this
.
last_row
==
persona_store_pos
+
1
)
get_child_at
(
0
,
persona_store_pos
).
destroy
();
bool
is_empty_persona
=
(
this
.
last_row
==
persona_store_pos
+
1
);
if
(!
is_first_persona
&&
is_empty_persona
)
{
this
.
container_grid
.
remove_row
(
persona_store_pos
);
this
.
last_row
--;
}
}
show_all
();
...
...
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