summaryrefslogtreecommitdiff
blob: deebe9b43772413ad4baa5d57507c93d1a2a9893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
===================================================================
RCS file: /cvs/gnome/epiphany-extensions/extensions/adblock/ephy-adblock-extension.c,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -r1.10 -r1.10.2.1
--- ephy-adblock-extension.c	2006/03/11 18:41:20	1.10
+++ ephy-adblock-extension.c	2006/03/16 14:59:22	1.10.2.1
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- *  $Id: epiphany-extensions-2.14.0.1-adblock.patch,v 1.1 2006/03/29 11:25:42 foser Exp $
+ *  $Id: epiphany-extensions-2.14.0.1-adblock.patch,v 1.1 2006/03/29 11:25:42 foser Exp $
  */
 
 #include "config.h"
@@ -270,11 +270,8 @@
 	statusbar = EPHY_STATUSBAR (ephy_window_get_statusbar (window));
 	g_return_if_fail (statusbar != NULL);
 
-	frame = g_object_get_data (G_OBJECT (statusbar), STATUSBAR_FRAME_KEY);
-	evbox = g_object_get_data (G_OBJECT (statusbar), STATUSBAR_EVBOX_KEY);
-
-	g_object_set_data (G_OBJECT (statusbar), STATUSBAR_FRAME_KEY, NULL);
-	g_object_set_data (G_OBJECT (statusbar), STATUSBAR_EVBOX_KEY, NULL);
+	frame = g_object_steal_data (G_OBJECT (statusbar), STATUSBAR_FRAME_KEY);
+	evbox = g_object_steal_data (G_OBJECT (statusbar), STATUSBAR_EVBOX_KEY);
 
 	g_return_if_fail (frame != NULL);
 	g_return_if_fail (evbox != NULL);
@@ -365,7 +362,8 @@
 }
 
 static AdBlocker *
-ensure_adblocker (EphyWindow *window, EphyEmbed *embed)
+ensure_adblocker (EphyWindow *window,
+		  EphyEmbed *embed)
 {
 	AdBlocker *blocker;
 
@@ -382,19 +380,19 @@
 		blocker = ad_blocker_new (ext->priv->tester);
 		g_return_val_if_fail (blocker != NULL, NULL);
 
-		g_object_set_data (G_OBJECT (embed), AD_BLOCKER_KEY, blocker);
+		g_object_set_data_full (G_OBJECT (embed), AD_BLOCKER_KEY,
+					blocker, (GDestroyNotify) g_object_unref);
 
 		g_signal_connect (embed, "ge-location",
-				G_CALLBACK (location_changed_cb), blocker);
+				  G_CALLBACK (location_changed_cb), blocker);
 
 		g_signal_connect (embed, "content-blocked",
-				G_CALLBACK (content_blocked_cb), blocker);
+				  G_CALLBACK (content_blocked_cb), blocker);
 	}
 
 	return blocker;
 }
 
-
 static void
 impl_attach_tab (EphyExtension *ext,
 		 EphyWindow *window,
@@ -422,15 +420,15 @@
 	
 	embed = ephy_tab_get_embed (tab);
 
-	blocker = g_object_get_data (G_OBJECT (embed), AD_BLOCKER_KEY);
+	blocker = g_object_steal_data (G_OBJECT (embed), AD_BLOCKER_KEY);
 	g_return_if_fail (blocker != NULL);
 
 	g_signal_handlers_disconnect_by_func
-		(G_OBJECT (embed), G_CALLBACK (content_blocked_cb), blocker);
+		(embed, G_CALLBACK (content_blocked_cb), blocker);
 	g_signal_handlers_disconnect_by_func
-		(G_OBJECT (embed), G_CALLBACK (location_changed_cb), blocker);
+		(embed, G_CALLBACK (location_changed_cb), blocker);
 	g_signal_handlers_disconnect_by_func
-		(G_OBJECT (blocker), G_CALLBACK (num_blocked_cb), blocker);
+		(blocker, G_CALLBACK (num_blocked_cb), embed);
 
 	g_object_unref (blocker);
 }