After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662609 - EmpathyAccountChooser clean up
EmpathyAccountChooser clean up
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
2.33.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks: 662604
 
 
Reported: 2011-10-24 14:23 UTC by Guillaume Desmottes
Modified: 2011-10-27 11:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
account-chooser: port to new coding style (56.68 KB, patch)
2011-10-24 14:24 UTC, Guillaume Desmottes
committed Details | Review
move down empathy_account_chooser_class_init() (3.73 KB, patch)
2011-10-24 14:24 UTC, Guillaume Desmottes
committed Details | Review
inline account_chooser_setup() (8.67 KB, patch)
2011-10-24 14:24 UTC, Guillaume Desmottes
committed Details | Review
account-chooser: use self->priv pattern (11.89 KB, patch)
2011-10-24 14:24 UTC, Guillaume Desmottes
committed Details | Review
account-chooser: use tp_g_signal_connect_object() (1.84 KB, patch)
2011-10-24 14:24 UTC, Guillaume Desmottes
committed Details | Review
account-chooser: replace finalize by dispose (1.66 KB, patch)
2011-10-24 14:24 UTC, Guillaume Desmottes
committed Details | Review
remove unused empathy_account_chooser_get_has_all_option() (2.03 KB, patch)
2011-10-24 14:24 UTC, Guillaume Desmottes
rejected Details | Review
move pre-defined filter at the end of the files (3.01 KB, patch)
2011-10-24 14:24 UTC, Guillaume Desmottes
committed Details | Review
factor out empathy_account_chooser_refilter() (2.23 KB, patch)
2011-10-24 14:25 UTC, Guillaume Desmottes
committed Details | Review
log-window: use empathy_account_chooser_refilter() (1.76 KB, patch)
2011-10-24 14:25 UTC, Guillaume Desmottes
committed Details | Review
account-chooser: make sure that TP_ACCOUNT_FEATURE_CONNECTION and TP_CONNECTION_FEATURE_CAPABILITIES are prepared (1.62 KB, patch)
2011-10-24 14:25 UTC, Guillaume Desmottes
committed Details | Review
factor out update_account() (1.62 KB, patch)
2011-10-24 14:25 UTC, Guillaume Desmottes
committed Details | Review
refilter if the TpConnection of a TpAccount is changed (1.60 KB, patch)
2011-10-24 14:25 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2011-10-24 14:23:56 UTC
I did some cleaning of EmpathyAccountChooser. Nothing really exciting (especially in the first patches) but it did fix a race when account are connecting/disconnecting.
Comment 1 Guillaume Desmottes 2011-10-24 14:24:39 UTC
Created attachment 199817 [details] [review]
account-chooser: port to new coding style

I wanted to clean the account chooser a bit but the old coding style makes me
cry...

It's good to do anyway, especially if we move this widget to a telepathy-gtk
lib at some point.
Comment 2 Guillaume Desmottes 2011-10-24 14:24:42 UTC
Created attachment 199818 [details] [review]
move down empathy_account_chooser_class_init()
Comment 3 Guillaume Desmottes 2011-10-24 14:24:44 UTC
Created attachment 199819 [details] [review]
inline account_chooser_setup()
Comment 4 Guillaume Desmottes 2011-10-24 14:24:47 UTC
Created attachment 199820 [details] [review]
account-chooser: use self->priv pattern
Comment 5 Guillaume Desmottes 2011-10-24 14:24:50 UTC
Created attachment 199821 [details] [review]
account-chooser: use tp_g_signal_connect_object()
Comment 6 Guillaume Desmottes 2011-10-24 14:24:53 UTC
Created attachment 199822 [details] [review]
account-chooser: replace finalize by dispose

It just unref one object so dispose is the best place.
Comment 7 Guillaume Desmottes 2011-10-24 14:24:56 UTC
Created attachment 199823 [details] [review]
remove unused empathy_account_chooser_get_has_all_option()
Comment 8 Guillaume Desmottes 2011-10-24 14:24:59 UTC
Created attachment 199824 [details] [review]
move pre-defined filter at the end of the files
Comment 9 Guillaume Desmottes 2011-10-24 14:25:02 UTC
Created attachment 199825 [details] [review]
factor out empathy_account_chooser_refilter()
Comment 10 Guillaume Desmottes 2011-10-24 14:25:05 UTC
Created attachment 199826 [details] [review]
log-window: use empathy_account_chooser_refilter()

It's cleaner than re-setting the same filter function.
Comment 11 Guillaume Desmottes 2011-10-24 14:25:08 UTC
Created attachment 199827 [details] [review]
account-chooser: make sure that TP_ACCOUNT_FEATURE_CONNECTION and TP_CONNECTION_FEATURE_CAPABILITIES are prepared

Most filter will need those.
Comment 12 Guillaume Desmottes 2011-10-24 14:25:11 UTC
Created attachment 199828 [details] [review]
factor out update_account()
Comment 13 Guillaume Desmottes 2011-10-24 14:25:14 UTC
Created attachment 199829 [details] [review]
refilter if the TpConnection of a TpAccount is changed
Comment 14 Chandni Verma 2011-10-26 22:49:23 UTC
Review of attachment 199817 [details] [review]:

++
Comment 15 Chandni Verma 2011-10-26 22:50:20 UTC
Review of attachment 199818 [details] [review]:

++
Comment 16 Chandni Verma 2011-10-26 22:51:02 UTC
Review of attachment 199819 [details] [review]:

++
Comment 17 Chandni Verma 2011-10-26 22:51:29 UTC
Review of attachment 199820 [details] [review]:

++
Comment 18 Chandni Verma 2011-10-26 22:52:05 UTC
Review of attachment 199821 [details] [review]:

++
Comment 19 Chandni Verma 2011-10-26 22:53:52 UTC
Review of attachment 199822 [details] [review]:

++
Comment 20 Chandni Verma 2011-10-26 22:56:14 UTC
Review of attachment 199823 [details] [review]:

++
Comment 21 Chandni Verma 2011-10-26 23:02:52 UTC
Review of attachment 199824 [details] [review]:

++
Comment 22 Chandni Verma 2011-10-26 23:19:23 UTC
Review of attachment 199825 [details] [review]:

++
Comment 23 Chandni Verma 2011-10-26 23:19:24 UTC
Review of attachment 199825 [details] [review]:

++
Comment 24 Chandni Verma 2011-10-26 23:21:53 UTC
Review of attachment 199826 [details] [review]:

++
Comment 25 Chandni Verma 2011-10-26 23:27:14 UTC
Review of attachment 199827 [details] [review]:

++
Comment 26 Chandni Verma 2011-10-26 23:31:06 UTC
Review of attachment 199828 [details] [review]:

++
Comment 27 Chandni Verma 2011-10-26 23:50:59 UTC
Review of attachment 199829 [details] [review]:

+       * just relying on the account status is not enough. In some case we the
+       * status change can be notified while the TpConnection is still
+       * preparing. */

unintentional slip, I guess.
Otherwise compiles fine and executes without segfault by my tests.
Comment 28 Danielle Madeley 2011-10-27 00:12:54 UTC
Review of attachment 199823 [details] [review]:

I don't think you should do this, since it's the inverse of set_has_all_option(), just because nobody uses it, they might.
Comment 29 Danielle Madeley 2011-10-27 00:22:00 UTC
(In reply to comment #27)

> unintentional slip, I guess.
> Otherwise compiles fine and executes without segfault by my tests.

?

~

All of this, except the patch I don't like, is fine to commit.
Comment 30 Guillaume Desmottes 2011-10-27 11:45:19 UTC
Attachment 199817 [details] pushed as f053dfe - account-chooser: port to new coding style
Attachment 199818 [details] pushed as 3c80977 - move down empathy_account_chooser_class_init()
Attachment 199819 [details] pushed as 8498eee - inline account_chooser_setup()
Attachment 199820 [details] pushed as 41a3bfc - account-chooser: use self->priv pattern
Attachment 199821 [details] pushed as 71ae7d4 - account-chooser: use tp_g_signal_connect_object()
Attachment 199822 [details] pushed as 40babd7 - account-chooser: replace finalize by dispose
Attachment 199824 [details] pushed as e220eb6 - move pre-defined filter at the end of the files
Attachment 199825 [details] pushed as 75e36b5 - factor out empathy_account_chooser_refilter()
Attachment 199826 [details] pushed as bdecc62 - log-window: use empathy_account_chooser_refilter()
Attachment 199827 [details] pushed as 14dba3c - account-chooser: make sure that TP_ACCOUNT_FEATURE_CONNECTION and TP_CONNECTION_FEATURE_CAPABILITIES are prepared
Attachment 199828 [details] pushed as a6d4518 - factor out update_account()
Attachment 199829 [details] pushed as 3b00a09 - refilter if the TpConnection of a TpAccount is changed
Comment 31 Guillaume Desmottes 2011-10-27 11:50:48 UTC
I drop this patch and merged it. Thanks for the review!