[gnome-control-center] Revert "network: make ModemManager dependency optional"
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Revert "network: make ModemManager dependency optional"
- Date: Thu, 21 Feb 2013 06:34:08 +0000 (UTC)
commit d5cf19be14ec8b2619aaa307730fed9663dd2565
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 21 07:30:46 2013 +0100
Revert "network: make ModemManager dependency optional"
This reverts commit 4ef8ae4017a6a2bebf0b83da99dcaf0dad7d6fc0.
configure.ac | 21 ++++-----------------
panels/network/Makefile.am | 5 -----
panels/network/cc-network-panel.c | 12 ------------
panels/network/net-device-mobile.c | 23 ++---------------------
4 files changed, 6 insertions(+), 55 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c2186c1..ba69638 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,6 +101,7 @@ POLKIT_REQUIRED_VERSION=0.103
GSD_REQUIRED_VERSION=3.7.3
NETWORK_MANAGER_REQUIRED_VERSION=0.9.7.995
NETWORK_MANAGER_APPLET_REQUIRED_VERSION=0.9.7.995
+MODEM_MANAGER_REQUIRED_VERSION=0.7
LIBNOTIFY_REQUIRED_VERSION=0.7.3
GNOME_DESKTOP_REQUIRED_VERSION=3.7.5
SCHEMAS_REQUIRED_VERSION=3.7.2.2
@@ -184,10 +185,11 @@ PKG_CHECK_MODULES(NETWORK_MANAGER, NetworkManager >= $NETWORK_MANAGER_REQUIRED_V
libnm-glib >= $NETWORK_MANAGER_REQUIRED_VERSION
libnm-glib-vpn >= $NETWORK_MANAGER_REQUIRED_VERSION
libnm-util >= $NETWORK_MANAGER_REQUIRED_VERSION
- libnm-gtk >= $NETWORK_MANAGER_APPLET_REQUIRED_VERSION,
+ libnm-gtk >= $NETWORK_MANAGER_APPLET_REQUIRED_VERSION
+ mm-glib >= $MODEM_MANAGER_REQUIRED_VERSION,
[have_networkmanager=yes], have_networkmanager=no)
if test "x$have_networkmanager" = xno ; then
- AC_MSG_WARN(*** Network panel will not be built (NetworkManager not found) ***)
+ AC_MSG_WARN(*** Network panel will not be built (NetworkManager or ModemManager not found) ***)
else
AC_DEFINE(BUILD_NETWORK, 1, [Define to 1 to build the Network panel])
fi
@@ -200,16 +202,6 @@ if test x${have_networkmanager} = xyes; then
AC_SUBST(NM_VPN_MODULE_DIR)
fi
-# Check for libmm-glib for ModemManager1 support
-PKG_CHECK_MODULES(MM_GLIB, mm-glib,
- [have_libmm_glib=yes], have_libmm_glib=no)
-if test "x$have_libmm_glib" = xno ; then
- AC_MSG_WARN(*** Network panel will not be built with ModemManager1 support (libmm-glib not found) ***)
-else
- AC_DEFINE(HAVE_MM_GLIB, 1, [Defined if libmm-glib is available])
-fi
-AM_CONDITIONAL(HAVE_MM_GLIB, test "x$have_libmm_glib" = "xyes")
-
# Check for gnome-bluetooth
PKG_CHECK_MODULES(BLUETOOTH, $COMMON_MODULES gnome-bluetooth-1.0 >= 3.5.5,
[have_bluetooth=yes], have_bluetooth=no)
@@ -543,11 +535,6 @@ if test "x$have_networkmanager" = "xyes"; then
else
AC_MSG_NOTICE([ Network panel disabled])
fi
-if test "x$have_libmm_glib" = "xyes"; then
- AC_MSG_NOTICE([** ModemManager1 support (Network panel)])
-else
- AC_MSG_NOTICE([ ModemManager1 support disabled])
-fi
if test "x$have_bluetooth" = "xyes"; then
AC_MSG_NOTICE([** gnome-bluetooth (Bluetooth panel)])
else
diff --git a/panels/network/Makefile.am b/panels/network/Makefile.am
index 6aed1f7..1b61259 100644
--- a/panels/network/Makefile.am
+++ b/panels/network/Makefile.am
@@ -54,11 +54,6 @@ libnetwork_la_LIBADD = $(PANEL_LIBS) $(NETWORK_PANEL_LIBS) $(NETWORK_MANAGER_LIB
libnetwork_la_LDFLAGS = $(PANEL_LDFLAGS)
-if HAVE_MM_GLIB
-libnetwork_la_CPPFLAGS = $(MM_GLIB_CFLAGS)
-libnetwork_la_LIBADD += $(MM_GLIB_LIBS)
-endif
-
resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies
$(srcdir)/network.gresource.xml)
cc-network-resources.c: network.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name
cc_network $<
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 0abedc8..b276b96 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -51,9 +51,7 @@
#include "network-dialogs.h"
#include "connection-editor/net-connection-editor.h"
-#if HAVE_MM_GLIB
#include <libmm-glib.h>
-#endif /* HAVE_MM_GLIB */
CC_PANEL_REGISTER (CcNetworkPanel, cc_network_panel)
@@ -75,9 +73,7 @@ struct _CcNetworkPanelPrivate
GtkBuilder *builder;
GtkWidget *treeview;
NMClient *client;
-#if HAVE_MM_GLIB
MMManager *modem_manager;
-#endif /* HAVE_MM_GLIB */
NMRemoteSettings *remote_settings;
gboolean updating_device;
guint nm_warning_idle;
@@ -220,9 +216,7 @@ cc_network_panel_dispose (GObject *object)
g_clear_object (&priv->cancellable);
g_clear_object (&priv->builder);
g_clear_object (&priv->client);
-#if HAVE_MM_GLIB
g_clear_object (&priv->modem_manager);
-#endif /* HAVE_MM_GLIB */
g_clear_object (&priv->remote_settings);
g_clear_object (&priv->kill_switch_header);
g_clear_object (&priv->rfkill);
@@ -692,7 +686,6 @@ panel_add_device (CcNetworkPanel *panel, NMDevice *device)
"id", nm_device_get_udi (device),
NULL);
-#if HAVE_MM_GLIB
if (type == NM_DEVICE_TYPE_MODEM &&
g_str_has_prefix (nm_device_get_udi (device), "/org/freedesktop/ModemManager1/Modem/")) {
GDBusObject *modem_object;
@@ -717,7 +710,6 @@ panel_add_device (CcNetworkPanel *panel, NMDevice *device)
NULL);
g_object_unref (modem_object);
}
-#endif /* HAVE_MM_GLIB */
/* add as a panel */
if (device_g_type != NET_TYPE_DEVICE) {
@@ -1334,9 +1326,7 @@ cc_network_panel_init (CcNetworkPanel *panel)
GtkTreeSelection *selection;
GtkWidget *widget;
GtkWidget *toplevel;
-#if HAVE_MM_GLIB
GDBusConnection *system_bus;
-#endif /* HAVE_MM_GLIB */
panel->priv = NETWORK_PANEL_PRIVATE (panel);
g_resources_register (cc_network_get_resource ());
@@ -1386,7 +1376,6 @@ cc_network_panel_init (CcNetworkPanel *panel)
g_signal_connect (panel->priv->client, "device-removed",
G_CALLBACK (device_removed_cb), panel);
-#if HAVE_MM_GLIB
/* Setup ModemManager client */
system_bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
if (system_bus == NULL) {
@@ -1405,7 +1394,6 @@ cc_network_panel_init (CcNetworkPanel *panel)
}
g_object_unref (system_bus);
}
-#endif /* HAVE_MM_GLIB */
widget = GTK_WIDGET (gtk_builder_get_object (panel->priv->builder,
"add_toolbutton"));
diff --git a/panels/network/net-device-mobile.c b/panels/network/net-device-mobile.c
index c7c4bb9..aafdc79 100644
--- a/panels/network/net-device-mobile.c
+++ b/panels/network/net-device-mobile.c
@@ -34,9 +34,7 @@
#include "panel-common.h"
#include "network-dialogs.h"
-#if HAVE_MM_GLIB
#include <libmm-glib.h>
-#endif /* HAVE_MM_GLIB */
#include "net-device-mobile.h"
@@ -54,7 +52,7 @@ struct _NetDeviceMobilePrivate
GDBusProxy *cdma_proxy;
/* New MM >= 0.7 support */
- gpointer mm_object;
+ MMObject *mm_object;
guint operator_name_updated;
NMAMobileProvidersDatabase *mpd;
@@ -249,7 +247,6 @@ device_mobile_refresh_equipment_id (NetDeviceMobile *device_mobile)
{
const gchar *equipment_id = NULL;
-#if HAVE_MM_GLIB
if (device_mobile->priv->mm_object != NULL) {
MMModem *modem;
@@ -264,13 +261,10 @@ device_mobile_refresh_equipment_id (NetDeviceMobile *device_mobile)
equipment_id);
}
} else {
-#endif /* HAVE_MM_GLIB */
/* Assume old MM handling */
equipment_id = g_object_get_data (G_OBJECT (device_mobile),
"ControlCenter::EquipmentIdentifier");
-#if HAVE_MM_GLIB
}
-#endif /* HAVE_MM_GLIB */
panel_set_device_widget_details (device_mobile->priv->builder, "imei", equipment_id);
}
@@ -318,7 +312,6 @@ device_mobile_find_provider (NetDeviceMobile *device_mobile,
static void
device_mobile_refresh_operator_name (NetDeviceMobile *device_mobile)
{
-#if HAVE_MM_GLIB
if (device_mobile->priv->mm_object != NULL) {
gchar *operator_name = NULL;
MMModem3gpp *modem_3gpp;
@@ -358,7 +351,6 @@ device_mobile_refresh_operator_name (NetDeviceMobile *device_mobile)
panel_set_device_widget_details (device_mobile->priv->builder, "provider", operator_name);
g_free (operator_name);
} else {
-#endif /* HAVE_MM_GLIB */
const gchar *gsm;
const gchar *cdma;
@@ -381,9 +373,7 @@ device_mobile_refresh_operator_name (NetDeviceMobile *device_mobile)
} else {
panel_set_device_widget_details (device_mobile->priv->builder, "provider", NULL);
}
-#if HAVE_MM_GLIB
}
-#endif /* HAVE_MM_GLIB */
}
static void
@@ -790,8 +780,6 @@ net_device_mobile_constructed (GObject *object)
nm_device_mobile_refresh_ui (device_mobile);
}
-#if HAVE_MM_GLIB
-
static void
operator_name_updated (MMModem3gpp *modem_3gpp_iface,
GParamSpec *pspec,
@@ -823,7 +811,6 @@ net_device_mobile_setup_modem_object (NetDeviceMobile *self)
}
}
-#endif /* HAVE_MM_GLIB */
static void
net_device_mobile_get_property (GObject *device_,
@@ -854,9 +841,7 @@ net_device_mobile_set_property (GObject *device_,
switch (prop_id) {
case PROP_MODEM_OBJECT:
self->priv->mm_object = g_value_dup_object (value);
-#if HAVE_MM_GLIB
net_device_mobile_setup_modem_object (self);
-#endif /* HAVE_MM_GLIB */
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec);
@@ -874,16 +859,12 @@ net_device_mobile_dispose (GObject *object)
g_clear_object (&priv->gsm_proxy);
g_clear_object (&priv->cdma_proxy);
-#if HAVE_MM_GLIB
if (priv->operator_name_updated) {
g_assert (priv->mm_object != NULL);
g_signal_handler_disconnect (mm_object_peek_modem_3gpp (priv->mm_object),
priv->operator_name_updated);
priv->operator_name_updated = 0;
}
-#endif /* HAVE_MM_GLIB */
-
g_clear_object (&priv->mm_object);
-
g_clear_object (&priv->mpd);
G_OBJECT_CLASS (net_device_mobile_parent_class)->dispose (object);
@@ -909,7 +890,7 @@ net_device_mobile_class_init (NetDeviceMobileClass *klass)
g_param_spec_object ("mm-object",
NULL,
NULL,
- G_TYPE_OBJECT,
+ MM_TYPE_OBJECT,
G_PARAM_READWRITE));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]