evolution r36631 - in trunk: . shell
- From: msuman svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r36631 - in trunk: . shell
- Date: Fri, 17 Oct 2008 05:18:16 +0000 (UTC)
Author: msuman
Date: Fri Oct 17 05:18:16 2008
New Revision: 36631
URL: http://svn.gnome.org/viewvc/evolution?rev=36631&view=rev
Log:
Matthew Barnes <mbarnes redhat com> ** Fix for bug #548469 (Drop support for deprecated libnm-glib).
Removed:
trunk/shell/e-shell-nm-glib.c
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/shell/ChangeLog
trunk/shell/Makefile.am
trunk/shell/e-shell-nm.c
trunk/shell/e-shell-window-commands.c
trunk/shell/e-shell-window.c
trunk/shell/e-shell.c
trunk/shell/e-shell.h
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Fri Oct 17 05:18:16 2008
@@ -1517,22 +1517,15 @@
NM_SUPPORT_PACKAGES=""
-PKG_CHECK_MODULES(NM, dbus-glib-1 libnm_glib, NM_SUPPORT_GLIB="yes", NM_SUPPORT_GLIB="no")
-if test "x$NM_SUPPORT_GLIB" = "xyes"; then
- AC_DEFINE(NM_SUPPORT_GLIB, 1, [network manager available])
- NM_SUPPORT_PACKAGES="dbus-1 dbus-glib-1 libnm_glib"
-else
- PKG_CHECK_MODULES(NM, dbus-glib-1, NM_SUPPORT="yes", NM_SUPPORT="no")
- AC_CHECK_HEADER(NetworkManager/NetworkManager.h, [ nm_header="yes" ] )
- if test "x$NM_SUPPORT" = "xyes" -a "x$nm_header" = "xyes"; then
+PKG_CHECK_MODULES(NM, dbus-glib-1, NM_SUPPORT="yes", NM_SUPPORT="no")
+AC_CHECK_HEADER(NetworkManager/NetworkManager.h, [ nm_header="yes" ] )
+if test "x$NM_SUPPORT" = "xyes" -a "x$nm_header" = "xyes"; then
AC_DEFINE(NM_SUPPORT, 1, [network manager available])
NM_SUPPORT_PACKAGES="dbus-1 dbus-glib-1"
- else
+else
NM_SUPPORT=no
- fi
-fi
+fi
-AM_CONDITIONAL(NM_SUPPORT_GLIB, test x$NM_SUPPORT_GLIB = xyes)
AM_CONDITIONAL(NM_SUPPORT, test x$NM_SUPPORT = xyes)
Modified: trunk/shell/Makefile.am
==============================================================================
--- trunk/shell/Makefile.am (original)
+++ trunk/shell/Makefile.am Fri Oct 17 05:18:16 2008
@@ -51,13 +51,9 @@
$(IDL_GENERATED_C): $(IDL_GENERATED_H)
-if NM_SUPPORT_GLIB
-NM_SUPPORT_FILES = e-shell-nm-glib.c
-else
if NM_SUPPORT
NM_SUPPORT_FILES = e-shell-nm.c
endif
-endif
# Data Server CORBA stuff
DATASERVER_IDL_GENERATED_H = \
Modified: trunk/shell/e-shell-nm.c
==============================================================================
--- trunk/shell/e-shell-nm.c (original)
+++ trunk/shell/e-shell-nm.c Fri Oct 17 05:18:16 2008
@@ -29,7 +29,7 @@
#include <stdio.h>
#include <string.h>
#include <glib.h>
-#include <e-shell-window.h>
+#include <e-shell.h>
#include <Evolution.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
@@ -41,14 +41,16 @@
E_SHELL_LINE_UP
} ShellLineStatus;
-static gboolean init_dbus (EShellWindow *window);
+gboolean e_shell_dbus_initialise (EShell *shell);
static DBusConnection *dbus_connection = NULL;
static gboolean
reinit_dbus (gpointer user_data)
{
- if (init_dbus (user_data))
+ EShell *shell = user_data;
+
+ if (e_shell_dbus_initialise (shell))
return FALSE;
/* keep trying to re-establish dbus connection */
@@ -60,21 +62,13 @@
e_shell_network_monitor (DBusConnection *connection G_GNUC_UNUSED,
DBusMessage *message, void *user_data)
{
- DBusError error;
const char *object;
ShellLineStatus status;
- EShellWindow *window = NULL;
- EShell *shell = NULL;
+ EShell *shell = user_data;
GNOME_Evolution_ShellState shell_state;
EShellLineStatus line_status;
+ DBusError error = DBUS_ERROR_INIT;
- if (!user_data || !E_IS_SHELL_WINDOW (user_data))
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
- window = E_SHELL_WINDOW (user_data);
- shell = e_shell_window_peek_shell (window);
-
- dbus_error_init (&error);
object = dbus_message_get_path (message);
if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected") &&
@@ -82,7 +76,7 @@
dbus_connection_unref (dbus_connection);
dbus_connection = NULL;
- g_timeout_add (3000, reinit_dbus, window);
+ g_timeout_add (3000, reinit_dbus, shell);
return DBUS_HANDLER_RESULT_HANDLED;
}
@@ -102,26 +96,26 @@
if (line_status == E_SHELL_LINE_STATUS_ONLINE && status == E_SHELL_LINE_DOWN) {
shell_state = GNOME_Evolution_FORCED_OFFLINE;
- e_shell_go_offline (shell, window, shell_state);
+ e_shell_set_line_status (shell, shell_state);
} else if (line_status == E_SHELL_LINE_STATUS_FORCED_OFFLINE && status == E_SHELL_LINE_UP) {
shell_state = GNOME_Evolution_USER_ONLINE;
- e_shell_go_online (shell, window, shell_state);
+ e_shell_set_line_status (shell, shell_state);
}
return DBUS_HANDLER_RESULT_HANDLED;
}
-static gboolean
-init_dbus (EShellWindow *window)
+gboolean
+e_shell_dbus_initialise (EShell *shell)
{
- DBusError error;
+ DBusError error = DBUS_ERROR_INIT;
if (dbus_connection != NULL)
return TRUE;
- dbus_error_init (&error);
- if (!(dbus_connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error))) {
- g_warning ("could not get system bus: %s\n", error.message);
+ dbus_connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
+ if (dbus_connection == NULL) {
+ g_warning ("%s", error.message);
dbus_error_free (&error);
return FALSE;
}
@@ -129,7 +123,7 @@
dbus_connection_setup_with_g_main (dbus_connection, NULL);
dbus_connection_set_exit_on_disconnect (dbus_connection, FALSE);
- if (!dbus_connection_add_filter (dbus_connection, e_shell_network_monitor, window, NULL))
+ if (!dbus_connection_add_filter (dbus_connection, e_shell_network_monitor, shell, NULL))
goto exception;
dbus_bus_add_match (dbus_connection,
@@ -138,6 +132,7 @@
"sender='" NM_DBUS_SERVICE "',"
"path='" NM_DBUS_PATH "'", &error);
if (dbus_error_is_set (&error)) {
+ g_warning ("%s", error.message);
dbus_error_free (&error);
goto exception;
}
@@ -151,18 +146,3 @@
return FALSE;
}
-
-gboolean
-e_shell_dbus_initialise (EShellWindow *window)
-{
- g_type_init ();
-
- return init_dbus (window);
-}
-
-void
-e_shell_dbus_dispose (EShellWindow *window)
-{
- //FIXME
- return;
-}
Modified: trunk/shell/e-shell-window-commands.c
==============================================================================
--- trunk/shell/e-shell-window-commands.c (original)
+++ trunk/shell/e-shell-window-commands.c Fri Oct 17 05:18:16 2008
@@ -1024,7 +1024,10 @@
EShellWindow *window,
const char *path)
{
- e_shell_go_offline (e_shell_window_peek_shell (window), window, GNOME_Evolution_USER_OFFLINE);
+ EShell *shell;
+
+ shell = e_shell_window_peek_shell (window);
+ e_shell_set_line_status (shell, GNOME_Evolution_USER_OFFLINE);
}
static void
@@ -1032,7 +1035,10 @@
EShellWindow *window,
const char *path)
{
- e_shell_go_online (e_shell_window_peek_shell (window), window, GNOME_Evolution_USER_ONLINE);
+ EShell *shell;
+
+ shell = e_shell_window_peek_shell (window);
+ e_shell_set_line_status (shell, GNOME_Evolution_USER_ONLINE);
}
static void
Modified: trunk/shell/e-shell-window.c
==============================================================================
--- trunk/shell/e-shell-window.c (original)
+++ trunk/shell/e-shell-window.c Fri Oct 17 05:18:16 2008
@@ -53,12 +53,8 @@
#include <string.h>
-#ifdef NM_SUPPORT_GLIB
-gboolean e_shell_nm_glib_initialise (EShellWindow *window);
-void e_shell_nm_glib_dispose (EShellWindow *window);
-#elif NM_SUPPORT
+#if NM_SUPPORT
gboolean e_shell_dbus_initialise (EShellWindow *window);
-void e_shell_dbus_dispose (EShellWindow *window);
#endif
/* A view for each component. These are all created when EShellWindow is
@@ -477,19 +473,24 @@
static void
offline_toggle_clicked_cb (EShellWindow *window)
{
- EShellWindowPrivate *priv = window->priv;
+ EShell *shell;
+ GNOME_Evolution_ShellState shell_state;
- switch (e_shell_get_line_status (priv->shell.eshell)) {
+ shell = window->priv->shell.eshell;
+
+ switch (e_shell_get_line_status (shell)) {
case E_SHELL_LINE_STATUS_ONLINE:
- e_shell_go_offline (priv->shell.eshell, window, GNOME_Evolution_USER_OFFLINE);
+ shell_state = GNOME_Evolution_USER_OFFLINE;
break;
case E_SHELL_LINE_STATUS_OFFLINE:
case E_SHELL_LINE_STATUS_FORCED_OFFLINE:
- e_shell_go_online (priv->shell.eshell, window, GNOME_Evolution_USER_ONLINE);
+ shell_state = GNOME_Evolution_USER_ONLINE;
break;
default:
g_return_if_reached();
}
+
+ e_shell_set_line_status (shell, shell_state);
}
static void
@@ -853,12 +854,6 @@
store_window_size (GTK_WIDGET (self));
}
- #ifdef NM_SUPPORT_GLIB
- e_shell_nm_glib_dispose (E_SHELL_WINDOW (object));
- #elif NM_SUPPORT
- e_shell_dbus_dispose (E_SHELL_WINDOW (object));
- #endif
-
(* G_OBJECT_CLASS (e_shell_window_parent_class)->dispose) (object);
}
Modified: trunk/shell/e-shell.c
==============================================================================
--- trunk/shell/e-shell.c (original)
+++ trunk/shell/e-shell.c Fri Oct 17 05:18:16 2008
@@ -316,9 +316,9 @@
e_passwords_set_online(online);
if (online)
- e_shell_go_online (shell, NULL, GNOME_Evolution_USER_ONLINE);
+ e_shell_set_line_status (shell, GNOME_Evolution_USER_ONLINE);
else
- e_shell_go_offline (shell, NULL, GNOME_Evolution_USER_OFFLINE);
+ e_shell_set_line_status (shell, GNOME_Evolution_USER_OFFLINE);
}
/*
static GNOME_Evolution_Component
@@ -716,9 +716,9 @@
e_passwords_set_online(start_online);
if (start_online)
- e_shell_go_online (shell, NULL, GNOME_Evolution_USER_ONLINE);
+ e_shell_set_line_status (shell, GNOME_Evolution_USER_ONLINE);
else
- e_shell_go_online (shell, NULL, GNOME_Evolution_USER_OFFLINE);
+ e_shell_set_line_status (shell, GNOME_Evolution_USER_OFFLINE);
return E_SHELL_CONSTRUCT_RESULT_OK;
}
@@ -1125,8 +1125,9 @@
}
}
-static void
-set_line_status(EShell *shell, GNOME_Evolution_ShellState shell_state)
+void
+e_shell_set_line_status (EShell *shell,
+ GNOME_Evolution_ShellState shell_state)
{
EShellPrivate *priv;
GSList *component_infos;
@@ -1180,43 +1181,6 @@
set_line_status_finished(shell);
}
-/**
- * e_shell_go_offline:
- * @shell:
- * @action_window: Obsolete/unused.
- *
- * Make the shell go into off-line mode.
- **/
-void
-e_shell_go_offline (EShell *shell,
- EShellWindow *action_window, GNOME_Evolution_ShellState shell_state)
-{
- g_return_if_fail (shell != NULL);
- g_return_if_fail (E_IS_SHELL (shell));
- g_return_if_fail (action_window != NULL);
- g_return_if_fail (action_window == NULL || E_IS_SHELL_WINDOW (action_window));
-
- set_line_status(shell, shell_state);
-}
-
-/**
- * e_shell_go_online:
- * @shell:
- * @action_window: Obsolete/unused.
- *
- * Make the shell go into on-line mode.
- **/
-void
-e_shell_go_online (EShell *shell,
- EShellWindow *action_window, GNOME_Evolution_ShellState shell_state)
-{
- g_return_if_fail (shell != NULL);
- g_return_if_fail (E_IS_SHELL (shell));
- g_return_if_fail (action_window == NULL || E_IS_SHELL_WINDOW (action_window));
-
- set_line_status(shell, shell_state);
-}
-
gboolean
e_shell_get_crash_recovery (EShell *shell)
{
Modified: trunk/shell/e-shell.h
==============================================================================
--- trunk/shell/e-shell.h (original)
+++ trunk/shell/e-shell.h Fri Oct 17 05:18:16 2008
@@ -119,10 +119,8 @@
void e_shell_close_all_windows (EShell *shell);
EShellLineStatus e_shell_get_line_status (EShell *shell);
-void e_shell_go_offline (EShell *shell,
- EShellWindow *action_window, GNOME_Evolution_ShellState shell_state);
-void e_shell_go_online (EShell *shell,
- EShellWindow *action_window, GNOME_Evolution_ShellState shell_state);
+void e_shell_set_line_status (EShell *shell,
+ GNOME_Evolution_ShellState shell_state);
gboolean e_shell_get_crash_recovery (EShell *shell);
void e_shell_set_crash_recovery (EShell *shell,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]