summaryrefslogtreecommitdiff
blob: 0ac61120449bc584a2dcd0aed7c3fc9f102b4698 (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
85
86
87
88
89
90
91
92
93
94
From c29d0825816a541c98a3b0b7f1d6bae454cba2b5 Mon Sep 17 00:00:00 2001
From: Alexandre Rostovtsev <tetromino@gmail.com>
Date: Wed, 7 Sep 2011 17:17:42 -0400
Subject: [PATCH] Make networkmanager optional

Some people cannot use it for various reasons (e.g. prefix).
---
 src/ephy-shell.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index c436da1..29b79e6 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -63,7 +63,9 @@ struct _EphyShellPrivate {
   EggToolbarsModel *toolbars_model;
   EggToolbarsModel *fs_toolbars_model;
   EphyExtensionsManager *extensions_manager;
+#ifdef ENABLE_NETWORK_MANAGER
   EphyNetworkManager *nm_proxy;
+#endif
   GtkWidget *bme;
   GtkWidget *history_window;
   GObject *pdm_dialog;
@@ -435,6 +437,8 @@ ephy_shell_new_window_cb (EphyEmbedSingle *single,
      NULL, NULL, flags, chromemask, is_popup, 0);
 }
 
+#ifdef ENABLE_NETWORK_MANAGER
+
 static void
 ephy_shell_sync_network_status (EphyNetworkManager *nm_proxy,
                                 NMState state,
@@ -452,6 +456,8 @@ ephy_shell_sync_network_status (EphyNetworkManager *nm_proxy,
   ephy_embed_single_set_network_status (single, net_status);
 }
 
+#endif /* ENABLE_NETWORK_MANAGER */
+
 static GObject*
 impl_get_embed_single (EphyEmbedShell *embed_shell)
 {
@@ -469,12 +475,14 @@ impl_get_embed_single (EphyEmbedShell *embed_shell)
 
     priv->embed_single_connected = TRUE;
 
+#ifdef ENABLE_NETWORK_MANAGER
     /* Now we need the net monitor   */
     if (ephy_shell_get_net_monitor (shell)) {
         ephy_shell_sync_network_status (priv->nm_proxy,
                                         ephy_network_manager_get_state (priv->nm_proxy),
                                         shell);
     }
+#endif
   }
 
   return embed_single;
@@ -563,6 +571,7 @@ ephy_shell_dispose (GObject *object)
     priv->bookmarks = NULL;
   }
 
+#ifdef ENABLE_NETWORK_MANAGER
   if (priv->nm_proxy != NULL) {
     LOG ("Unref net monitor ");
     g_signal_handlers_disconnect_by_func
@@ -570,6 +579,7 @@ ephy_shell_dispose (GObject *object)
     g_object_unref (priv->nm_proxy);
     priv->nm_proxy = NULL;
   }
+#endif /* ENABLE_NETWORK_MANAGER */
 
   G_OBJECT_CLASS (ephy_shell_parent_class)->dispose (object);
 }
@@ -915,6 +925,7 @@ ephy_shell_get_extensions_manager (EphyShell *es)
 GObject *
 ephy_shell_get_net_monitor (EphyShell *shell)
 {
+#ifdef ENABLE_NETWORK_MANAGER
   EphyShellPrivate *priv = shell->priv;
 
   if (priv->nm_proxy == NULL) {
@@ -929,6 +940,9 @@ ephy_shell_get_net_monitor (EphyShell *shell)
   }
 
   return G_OBJECT (priv->nm_proxy);
+#else
+  return NULL;
+#endif /* ENABLE_NETWORK_MANAGER */
 }
 
 static void
-- 
1.7.6.1