Skip to content

Commit dfa0fd1

Browse files
yetistraveit65
authored andcommitted
Load avatar-default as default image
First show UI with avatar-default, after user loaded, show user image.
1 parent a6f0e57 commit dfa0fd1

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

capplets/about-me/mate-about-me.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,11 @@ about_me_load_photo (MateAboutMe *me)
9696
#if HAVE_ACCOUNTSSERVICE
9797
const gchar *act_file;
9898

99-
act_file = act_user_get_icon_file (me->user);
100-
if ( act_file != NULL && strlen (act_file) > 1) {
101-
file = g_strdup (act_file);
99+
if (act_user_is_loaded (me->user)) {
100+
act_file = act_user_get_icon_file (me->user);
101+
if ( act_file != NULL && strlen (act_file) > 1) {
102+
file = g_strdup (act_file);
103+
}
102104
}
103105
#endif
104106
if (file == NULL) {
@@ -410,10 +412,12 @@ about_me_fingerprint_button_clicked_cb (GtkWidget *button, MateAboutMe *me)
410412
#if HAVE_ACCOUNTSSERVICE
411413
static void on_user_is_loaded_changed (ActUser *user, GParamSpec *pspec, MateAboutMe* me)
412414
{
413-
if (!act_user_is_loaded (user)) {
414-
return;
415+
if (act_user_is_loaded (user)) {
416+
about_me_load_photo (me);
417+
g_signal_handlers_disconnect_by_func (G_OBJECT (user),
418+
G_CALLBACK (on_user_is_loaded_changed),
419+
me);
415420
}
416-
about_me_load_photo (me);
417421
}
418422
#endif
419423

@@ -427,7 +431,6 @@ about_me_setup_dialog (void)
427431
gchar *str;
428432
#if HAVE_ACCOUNTSSERVICE
429433
ActUserManager* manager;
430-
gboolean loaded;
431434
#endif
432435

433436
me = g_new0 (MateAboutMe, 1);
@@ -475,17 +478,10 @@ about_me_setup_dialog (void)
475478
#if HAVE_ACCOUNTSSERVICE
476479
manager = act_user_manager_get_default ();
477480
me->user = act_user_manager_get_user (manager, me->login);
478-
g_object_get (manager, "is-loaded", &loaded, NULL);
479-
if (!loaded) {
480-
g_signal_connect (me->user, "notify::is-loaded", G_CALLBACK (on_user_is_loaded_changed), me);
481-
} else {
482-
/* Contact Tab */
483-
about_me_load_photo (me);
484-
}
485-
#else
481+
g_signal_connect (me->user, "notify::is-loaded", G_CALLBACK (on_user_is_loaded_changed), me);
482+
#endif
486483
/* Contact Tab */
487484
about_me_load_photo (me);
488-
#endif
489485

490486
widget = WID ("fullname");
491487
str = g_strdup_printf ("<b><span size=\"xx-large\">%s</span></b>", me->username);

0 commit comments

Comments
 (0)