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 642264 - Reset Networks' list button in IRC network chooser dialog
Reset Networks' list button in IRC network chooser dialog
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Accounts
unspecified
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-02-14 02:32 UTC by Chandni Verma
Modified: 2011-02-15 08:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Reset Networks' list button (7.33 KB, patch)
2011-02-14 04:02 UTC, Chandni Verma
reviewed Details | Review
Reset Networks' list button (7.28 KB, patch)
2011-02-14 13:36 UTC, Chandni Verma
reviewed Details | Review

Description Chandni Verma 2011-02-14 02:32:25 UTC
as indicated by Danielle in https://bugzilla.gnome.org/show_bug.cgi?id=641861#c10
Comment 1 Chandni Verma 2011-02-14 04:02:09 UTC
Created attachment 180800 [details] [review]
Reset Networks' list button

Commit branch: http://gitorious.org/glassrose-gnome/empathy/commits/Reset-network-list-button-641861
Comment 2 Guillaume Desmottes 2011-02-14 09:36:52 UTC
Review of attachment 180800 [details] [review]:

::: libempathy-gtk/empathy-irc-network-chooser-dialog.c
@@ +49,3 @@
 
+enum {
+	RESPONSE_RESET

Please set an explicit value. 0 is fine as the GTK_RESPONSE_ are all < 0.

@@ +403,3 @@
+      priv->network_manager);
+
+  for (l=networks; l!=NULL; l=g_slist_next(l))

missing space between = and !=

@@ +417,3 @@
+
+      filter_iter = iter_to_filter_iter (self, &iter);
+      select_iter (self, &filter_iter, TRUE);

Do we really want to select it?

@@ +585,3 @@
       GTK_STOCK_EDIT, GTK_RESPONSE_APPLY,
       GTK_STOCK_REMOVE, GTK_RESPONSE_REJECT,
+      "Reset _Networks List", RESPONSE_RESET,

This string should be translatable.

::: libempathy/empathy-irc-network-manager.c
@@ +390,3 @@
+static GSList *
+get_network_list (EmpathyIrcNetworkManager *self,
+    gboolean get_active)

I'd name it get_dropped to stay coherent.

::: libempathy/empathy-irc-network.c
@@ +235,3 @@
+  self->dropped = FALSE;
+
+  g_signal_emit (self, signals[MODIFIED], 0);

We shouldn't fire this sig if self->dropped was already FALSE.

::: libempathy/empathy-irc-network.h
@@ +63,3 @@
                               EmpathyIrcNetworkClass))
 
+void activate_network (EmpathyIrcNetwork *self);

This should be empathy_irc_network_... as that's a public function.
Comment 3 Chandni Verma 2011-02-14 13:36:07 UTC
Created attachment 180826 [details] [review]
Reset Networks' list button

> ::: libempathy/empathy-irc-network-manager.c
> @@ +390,3 @@
> +static GSList *
> +get_network_list (EmpathyIrcNetworkManager *self,
> +    gboolean get_active)
> 
> I'd name it get_dropped to stay coherent.
> 

This method is used by both empathy_irc_network_manager_get_networks and empathy_irc_network_manager_get_dropped_networks so I used a generic name.



> ::: libempathy/empathy-irc-network.c
> @@ +235,3 @@
> +  self->dropped = FALSE;
> +
> +  g_signal_emit (self, signals[MODIFIED], 0);
> 
> We shouldn't fire this sig if self->dropped was already FALSE.
> 

I am calling this method (empathy_irc_network_activate) only on networks that are dropped, so I don't see any need to put another check!?

Rest changes made.
Public branch updated.
Comment 4 Guillaume Desmottes 2011-02-14 15:43:35 UTC
Review of attachment 180826 [details] [review]:

::: libempathy-gtk/empathy-irc-network-chooser-dialog.c
@@ +403,3 @@
+      priv->network_manager);
+
+  for (l=networks; l != NULL; l = g_slist_next(l))

still missing space between = and g_slist_next (l).
Comment 5 Guillaume Desmottes 2011-02-14 15:45:25 UTC
(In reply to comment #3)
> > ::: libempathy/empathy-irc-network.c
> > @@ +235,3 @@
> > +  self->dropped = FALSE;
> > +
> > +  g_signal_emit (self, signals[MODIFIED], 0);
> > 
> > We shouldn't fire this sig if self->dropped was already FALSE.
> > 
> 
> I am calling this method (empathy_irc_network_activate) only on networks that
> are dropped, so I don't see any need to put another check!?

It's to make your code more robust and less dependent of the part calling it.
Another option could be to add a g_return_if_fail (self->dropped); if you prefer to really ensure your existing logic.
Comment 6 Chandni Verma 2011-02-14 17:14:19 UTC
robustness is good.
branch updated.
Comment 8 Guillaume Desmottes 2011-02-15 08:20:42 UTC
Thanks; merged to 2.34 and master.

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.