commit 90fdfd127c329082ce6c9bd6828eed60070fd325
Author: Chenthill Palanisamy <pchenthill@novell.com>
Date:   Tue Mar 20 18:29:04 2012 +0530

    Use e_book_backend_foreach_view for notifying status messages to all the views.

diff --git a/src/addressbook/e-book-backend-ews-utils.c b/src/addressbook/e-book-backend-ews-utils.c
deleted file mode 100644
index 193fc4f..0000000
--- a/src/addressbook/e-book-backend-ews-utils.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* e-book-backend-ews-utils.c - Ews personal addressbook and GAL common funtions.
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <time.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <glib.h>
-#include <glib/gstdio.h>
-#include <glib/gi18n-lib.h>
-
-#include <libedata-book/e-book-backend-sexp.h>
-#include <libedata-book/e-book-backend.h>
-#include <libedata-book/e-data-book.h>
-#include <libedata-book/e-data-book-view.h>
-#include <libedataserver/eds-version.h>
-#include "e-book-backend-ews-utils.h"
-
-/**
- * e_book_backend_ews_utils_get_book_view:
- * @backend: an #EBookBackend
- *
- * Gets the currrent (first) #EDataBookView from this backend.
- *
- * Returns: An #EDataBookView object.
- **/
-
-#if ! EDS_CHECK_VERSION (3,1,0)	
-EDataBookView *
-e_book_backend_ews_utils_get_book_view (EBookBackend *backend)
-{
-	EList *views = e_book_backend_get_book_views (backend);
-	EIterator *iter;
-	EDataBookView *rv = NULL;
-
-	if (!views)
-		return NULL;
-
-	iter = e_list_get_iterator (views);
-
-	if (!iter) {
-		g_object_unref (views);
-		return NULL;
-	}
-
-	if (e_iterator_is_valid (iter)) {
-		/* just always use the first book view */
-		EDataBookView *v = (EDataBookView*)e_iterator_get (iter);
-		if (v) {
-			rv = v;
-			e_data_book_view_ref (rv);
-		}
-	}
-
-	g_object_unref (iter);
-	g_object_unref (views);
-	return rv;
-}
-#else
-
-static gboolean
-get_book_view (EDataBookView *view, gpointer user_data)
-{
-	EDataBookView **ret = (EDataBookView **) user_data;
-	
-	e_data_book_view_ref (view);
-	*ret = view;
-
-	return FALSE;
-}
-EDataBookView *
-e_book_backend_ews_utils_get_book_view (EBookBackend *backend)
-{
-	EDataBookView *ret = NULL;
-
-	e_book_backend_foreach_view (backend, get_book_view, &ret);
-
-	return ret;
-}
-
-#endif
diff --git a/src/addressbook/e-book-backend-ews-utils.h b/src/addressbook/e-book-backend-ews-utils.h
deleted file mode 100644
index c5c93c0..0000000
--- a/src/addressbook/e-book-backend-ews-utils.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/* e-book-backend-ews-utils.h - Ews Personal addressbook and GAL common functions
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "libedata-book/e-data-book-view.h"
-
-EDataBookView*		e_book_backend_ews_utils_get_book_view (EBookBackend *backend);
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index 8e7d09e..ee23dd4 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -178,6 +178,9 @@ ews_book_view_each_notify_status (EBookBackend *backend,
 		e_iterator_next (iter);
 	}
 
+	g_object_unref (iter);
+	g_object_unref (views);
+
 	return TRUE;
 }
 
