diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2001-10-04 02:03:14 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2001-10-04 02:03:14 +0800 |
commit | 967083749da817df0ea296343528361c3564a798 (patch) | |
tree | 669a3acc0d27852b72a3a5de34446e8ad8d6806b /calendar/gui | |
parent | 6726c35ab5c59ac587a3347117b86e91e8655337 (diff) | |
download | gsoc2013-evolution-967083749da817df0ea296343528361c3564a798.tar.gz gsoc2013-evolution-967083749da817df0ea296343528361c3564a798.tar.zst gsoc2013-evolution-967083749da817df0ea296343528361c3564a798.zip |
replace use of gnome_vfs_uri with e_uri
2001-10-03 Rodrigo Moya <rodrigo@ximian.com>
* gui/component-factory.c:
* gui/calendar-offline-handler.c:
* gui/comp-editor-factory.c: replace use of gnome_vfs_uri with e_uri
* gui/e-meeting-model.c (start_addressbook_server): make it return void,
since the return value does not mind
* pcs/cal.c:
* pcs/cal-factory.c:
* pcs/cal-backend.[ch]: don't use GnomeVFS for URI management
* pcs/cal-backend-file.c: ditto, only use GnomeVFS for internal
operations
* cal-client/cal-client.c (cal_client_open_calendar): don't CORBA_exception_free
before checking for exceptions
svn path=/trunk/; revision=13380
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/calendar-offline-handler.c | 15 | ||||
-rw-r--r-- | calendar/gui/comp-editor-factory.c | 39 | ||||
-rw-r--r-- | calendar/gui/e-meeting-model.c | 2 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 11 |
4 files changed, 28 insertions, 39 deletions
diff --git a/calendar/gui/calendar-offline-handler.c b/calendar/gui/calendar-offline-handler.c index e804bc8040..53db8f46e5 100644 --- a/calendar/gui/calendar-offline-handler.c +++ b/calendar/gui/calendar-offline-handler.c @@ -30,9 +30,8 @@ #include <gtk/gtkmain.h> #include <gtk/gtksignal.h> #include <bonobo/bonobo-exception.h> -#include <libgnomevfs/gnome-vfs-types.h> -#include <libgnomevfs/gnome-vfs-uri.h> #include <gal/util/e-util.h> +#include "e-util/e-url.h" #include <cal-client/cal-client.h> #include "calendar-offline-handler.h" @@ -50,18 +49,16 @@ struct _CalendarOfflineHandlerPrivate { static void add_connection (gpointer data, gpointer user_data) { - GnomeVFSURI *uri = gnome_vfs_uri_new (data); + EUri *uri = e_uri_new (data); GNOME_Evolution_ConnectionList *list = user_data; g_return_if_fail (uri != NULL); - list->_buffer[list->_length].hostName - = CORBA_string_dup (gnome_vfs_uri_get_host_name (uri)); - list->_buffer[list->_length].type - = CORBA_string_dup (gnome_vfs_uri_get_scheme (uri)); + list->_buffer[list->_length].hostName = CORBA_string_dup (uri->host); + list->_buffer[list->_length].type = CORBA_string_dup (uri->protocol); list->_length++; - gnome_vfs_uri_unref (uri); + e_uri_free (uri); } static GNOME_Evolution_ConnectionList * @@ -72,7 +69,7 @@ create_connection_list (CalendarOfflineHandler *offline_handler) GList *uris; priv = offline_handler->priv; - + uris = cal_client_uri_list (priv->client, CAL_MODE_REMOTE); list = GNOME_Evolution_ConnectionList__alloc (); diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c index 7d1bfaff2d..2c74649647 100644 --- a/calendar/gui/comp-editor-factory.c +++ b/calendar/gui/comp-editor-factory.c @@ -23,7 +23,7 @@ #include <config.h> #endif -#include <libgnomevfs/gnome-vfs.h> +#include <e-util/e-url.h> #include <cal-client/cal-client.h> #include "calendar-config.h" #include "comp-editor-factory.h" @@ -59,7 +59,7 @@ typedef struct { CompEditorFactory *factory; /* Uri of the calendar, used as key in the clients hash table */ - GnomeVFSURI *uri; + char *uri; /* Client of the calendar */ CalClient *client; @@ -106,7 +106,7 @@ static void impl_editExisting (PortableServer_Servant servant, const GNOME_Evolution_Calendar_CalObjUID uid, CORBA_Environment *ev); static void impl_editNew (PortableServer_Servant servant, - const CORBA_char *uri, + const CORBA_char *str_uri, const GNOME_Evolution_Calendar_CalObjType type, CORBA_Environment *ev); @@ -144,7 +144,7 @@ comp_editor_factory_init (CompEditorFactory *factory) priv = g_new (CompEditorFactoryPrivate, 1); factory->priv = priv; - priv->uri_client_hash = g_hash_table_new (gnome_vfs_uri_hash, gnome_vfs_uri_hequal); + priv->uri_client_hash = g_hash_table_new (g_str_hash, g_str_equal); } /* Used from g_hash_table_foreach(); frees a component structure */ @@ -182,7 +182,7 @@ free_client (OpenClient *oc) { GSList *l; - gnome_vfs_uri_unref (oc->uri); + g_free (oc->uri); oc->uri = NULL; gtk_object_unref (GTK_OBJECT (oc->client)); @@ -494,12 +494,11 @@ cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data) * open request. */ static OpenClient * -open_client (CompEditorFactory *factory, GnomeVFSURI *uri) +open_client (CompEditorFactory *factory, const char *uristr) { CompEditorFactoryPrivate *priv; CalClient *client; OpenClient *oc; - char *str_uri; priv = factory->priv; @@ -510,8 +509,7 @@ open_client (CompEditorFactory *factory, GnomeVFSURI *uri) oc = g_new (OpenClient, 1); oc->factory = factory; - gnome_vfs_uri_ref (uri); - oc->uri = uri; + oc->uri = g_strdup (uristr); oc->client = client; oc->uid_comp_hash = g_hash_table_new (g_str_hash, g_str_equal); @@ -521,18 +519,14 @@ open_client (CompEditorFactory *factory, GnomeVFSURI *uri) gtk_signal_connect (GTK_OBJECT (oc->client), "cal_opened", GTK_SIGNAL_FUNC (cal_opened_cb), oc); - str_uri = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE); - - if (!cal_client_open_calendar (oc->client, str_uri, FALSE)) { - g_free (str_uri); - gnome_vfs_uri_unref (oc->uri); + if (!cal_client_open_calendar (oc->client, uristr, FALSE)) { + g_free (oc->uri); gtk_object_unref (GTK_OBJECT (oc->client)); g_hash_table_destroy (oc->uid_comp_hash); g_free (oc); return NULL; } - g_free (str_uri); g_hash_table_insert (priv->uri_client_hash, oc->uri, oc); @@ -546,27 +540,26 @@ static OpenClient * lookup_open_client (CompEditorFactory *factory, const char *str_uri, CORBA_Environment *ev) { CompEditorFactoryPrivate *priv; - GnomeVFSURI *uri; OpenClient *oc; + EUri *uri; priv = factory->priv; /* Look up the client */ - uri = gnome_vfs_uri_new (str_uri); + uri = e_uri_new (str_uri); if (!uri) { CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Calendar_CompEditorFactory_InvalidURI, NULL); return NULL; } + e_uri_free (uri); - oc = g_hash_table_lookup (priv->uri_client_hash, uri); + oc = g_hash_table_lookup (priv->uri_client_hash, str_uri); if (!oc) { - oc = open_client (factory, uri); + oc = open_client (factory, str_uri); if (!oc) { - gnome_vfs_uri_unref (uri); - CORBA_exception_set ( ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Calendar_CompEditorFactory_BackendContactError, @@ -575,8 +568,6 @@ lookup_open_client (CompEditorFactory *factory, const char *str_uri, CORBA_Envir } } - gnome_vfs_uri_unref (uri); - return oc; } @@ -700,3 +691,5 @@ comp_editor_factory_new (void) { return gtk_type_new (TYPE_COMP_EDITOR_FACTORY); } + + diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c index a545c0bbf9..712406d9e1 100644 --- a/calendar/gui/e-meeting-model.c +++ b/calendar/gui/e-meeting-model.c @@ -147,7 +147,7 @@ book_open_cb (EBook *book, EBookStatus status, gpointer data) } } -static int +static void start_addressbook_server (EMeetingModel *im) { EMeetingModelPrivate *priv; diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 44bf54ec61..d220db17dd 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -35,11 +35,10 @@ #include <libgnome/gnome-util.h> #include <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-dialog-util.h> -#include <libgnomevfs/gnome-vfs-types.h> -#include <libgnomevfs/gnome-vfs-uri.h> #include <liboaf/liboaf.h> #include <gal/e-paned/e-hpaned.h> #include <gal/e-paned/e-vpaned.h> +#include "e-util/e-url.h" #include <cal-util/timeutil.h> #include "widgets/menus/gal-view-menus.h" #include "dialogs/event-editor.h" @@ -1657,7 +1656,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri) GnomeCalendarPrivate *priv; char *tasks_uri; gboolean success; - GnomeVFSURI *uri; + EUri *uri; g_return_val_if_fail (gcal != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE); @@ -1682,7 +1681,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri) /* Open the appropriate Tasks folder to show in the TaskPad */ - uri = gnome_vfs_uri_new_private (str_uri, TRUE, TRUE, TRUE); + uri = e_uri_new (str_uri); if (!uri) { tasks_uri = g_strdup_printf ("%s/local/Tasks/tasks.ics", evolution_dir); success = cal_client_open_calendar (priv->task_pad_client, tasks_uri, FALSE); @@ -1691,7 +1690,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri) g_free (tasks_uri); } else { - if (!g_strcasecmp (uri->method_string, "file")) { + if (!g_strncasecmp (uri->protocol, "file", 4)) { tasks_uri = g_strdup_printf ("%s/local/Tasks/tasks.ics", evolution_dir); success = cal_client_open_calendar (priv->task_pad_client, tasks_uri, FALSE); @@ -1719,7 +1718,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri) success = TRUE; } - gnome_vfs_uri_unref (uri); + e_uri_free (uri); } if (!success) { |