aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/ipod-sync
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-11-15 06:04:21 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-11-15 06:04:21 +0800
commit9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91 (patch)
tree2e1e96f33404781354c422a7e9beaf458ebeb655 /plugins/ipod-sync
parent7e8f8bb9e5167b0219b48ab3e8062080d3740b0a (diff)
downloadgsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.gz
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.bz2
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.lz
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.xz
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.zst
gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.zip
** Remove trailing whitespace from source code.
2007-11-14 Matthew Barnes <mbarnes@redhat.com> ** Remove trailing whitespace from source code. svn path=/trunk/; revision=34537
Diffstat (limited to 'plugins/ipod-sync')
-rw-r--r--plugins/ipod-sync/evolution-ipod-sync.c8
-rw-r--r--plugins/ipod-sync/ical-format.c6
-rw-r--r--plugins/ipod-sync/ipod-sync.c14
-rw-r--r--plugins/ipod-sync/ipod.c26
-rw-r--r--plugins/ipod-sync/sync.c66
5 files changed, 60 insertions, 60 deletions
diff --git a/plugins/ipod-sync/evolution-ipod-sync.c b/plugins/ipod-sync/evolution-ipod-sync.c
index 73e5536c17..63372f5459 100644
--- a/plugins/ipod-sync/evolution-ipod-sync.c
+++ b/plugins/ipod-sync/evolution-ipod-sync.c
@@ -25,7 +25,7 @@ ipod_check_status (gboolean silent)
{
LibHalContext *ctx;
DBusConnection *conn;
-
+
if (check_hal () == FALSE)
{
if (!silent) {
@@ -45,9 +45,9 @@ ipod_check_status (gboolean silent)
gtk_widget_destroy (message);
}
return FALSE;
-
+
}
-
+
conn = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
ctx = libhal_ctx_new ();
@@ -55,7 +55,7 @@ ipod_check_status (gboolean silent)
if (!libhal_ctx_init(ctx, NULL))
return FALSE;
-
+
mount_point = find_ipod_mount_point (ctx);
if (mount_point == NULL) {
diff --git a/plugins/ipod-sync/ical-format.c b/plugins/ipod-sync/ical-format.c
index e747255124..38607a6e97 100644
--- a/plugins/ipod-sync/ical-format.c
+++ b/plugins/ipod-sync/ical-format.c
@@ -1,8 +1,8 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Authors: Rodrigo Moya <rodrigo@novell.com>
+ * Authors: Rodrigo Moya <rodrigo@novell.com>
* Philip Van Hoof <pvanhoof@gnome.org>
- *
+ *
* Copyright 2004 Novell, Inc. (www.novell.com)
*
* This program is free software; you can redistribute it and/or
@@ -85,7 +85,7 @@ do_save_calendar_ical (FormatHandler *handler, EPlugin *ep, ECalPopupTargetSourc
while (objects != NULL) {
icalcomponent *icalcomp = objects->data;
-
+
icalcomponent_add_component (top_level, icalcomp);
/* remove item from the list */
diff --git a/plugins/ipod-sync/ipod-sync.c b/plugins/ipod-sync/ipod-sync.c
index dc8a0d67be..dd89b34e8f 100644
--- a/plugins/ipod-sync/ipod-sync.c
+++ b/plugins/ipod-sync/ipod-sync.c
@@ -75,13 +75,13 @@ destination_save_addressbook (EPlugin *ep, EABPopupTargetSource *target)
char *mount = ipod_get_mount();
primary_source = e_source_selector_peek_primary_selection (target->selector);
-
+
/* use g_file api here to build path*/
dest_uri = g_strdup_printf("%s/%s/Evolution-Addressbook-%s.vcf", mount, "Contacts", e_source_peek_name (primary_source));
g_free (mount);
-
+
uri = e_source_get_uri (primary_source);
-
+
book = e_book_new_from_uri (uri, NULL);
if (!book
@@ -112,7 +112,7 @@ destination_save_addressbook (EPlugin *ep, EABPopupTargetSource *target)
EContact *contact = tmp->data;
gchar *temp = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
gchar *vcard;
-
+
vcard = g_strconcat(temp, "\r\n", NULL);
if ((result = gnome_vfs_write (handle, (gconstpointer) vcard, strlen (vcard), &bytes_written))
!= GNOME_VFS_OK) {
@@ -137,7 +137,7 @@ destination_save_addressbook (EPlugin *ep, EABPopupTargetSource *target)
g_free (uri);
}
-static void
+static void
destination_save_cal (EPlugin *ep, ECalPopupTargetSource *target, ECalSourceType type)
{
FormatHandler *handler = NULL;
@@ -155,7 +155,7 @@ destination_save_cal (EPlugin *ep, ECalPopupTargetSource *target, ECalSourceType
handler->save (handler, ep, target, type, dest_uri);
sync();
-
+
g_free (dest_uri);
g_free (mount);
g_free (handler);
@@ -175,7 +175,7 @@ org_gnome_sync_tasks (EPlugin *ep, ECalPopupTargetSource *target)
{
if (!ipod_check_status(FALSE))
return;
-
+
destination_save_cal (ep, target, E_CAL_SOURCE_TYPE_TODO);
}
diff --git a/plugins/ipod-sync/ipod.c b/plugins/ipod-sync/ipod.c
index 292d07681f..4edfd6a2dd 100644
--- a/plugins/ipod-sync/ipod.c
+++ b/plugins/ipod-sync/ipod.c
@@ -23,7 +23,7 @@ check_hal (void)
char **devices;
int num;
DBusConnection *conn;
-
+
conn = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
ctx = libhal_ctx_new ();
@@ -105,7 +105,7 @@ static gboolean
is_ipod (char *mount_point)
{
gboolean ret = FALSE;
-
+
char *itunes_path;
itunes_path = g_build_path (G_DIR_SEPARATOR_S, mount_point,
@@ -114,7 +114,7 @@ is_ipod (char *mount_point)
if (!g_file_test (itunes_path, G_FILE_TEST_IS_DIR))
goto out;
-
+
ret = TRUE;
out:
@@ -147,7 +147,7 @@ find_ipod_mount_point (LibHalContext *ctx)
for (i = 0; i < apple_count; i++)
{
udi = apple_devices[i];
-
+
volumes = NULL;
volumes = libhal_manager_find_device_string_match (ctx,
"info.parent",
@@ -161,7 +161,7 @@ find_ipod_mount_point (LibHalContext *ctx)
/* Only interested if it has a filesystem. */
has_fs = 0;
-
+
if (!libhal_device_property_exists (ctx, udi2,
"volume.is_filesystem", NULL) ||
!libhal_device_get_property_bool (ctx, udi2,
@@ -169,7 +169,7 @@ find_ipod_mount_point (LibHalContext *ctx)
{
has_fs = 1;
}
-
+
fsusage = libhal_device_get_property_string (ctx, udi2,
"volume.fsusage", NULL);
@@ -185,7 +185,7 @@ find_ipod_mount_point (LibHalContext *ctx)
if (has_fs == 0)
continue;
-
+
device = libhal_device_get_property_string (ctx, udi2,
"block.device", NULL);
@@ -198,7 +198,7 @@ find_ipod_mount_point (LibHalContext *ctx)
/* It isn't, so let's attempt to mount it */
if (device != NULL)
{
- try_mount (device);
+ try_mount (device);
}
}
@@ -210,10 +210,10 @@ find_ipod_mount_point (LibHalContext *ctx)
}
libhal_free_string (device);
-
+
mount_point = libhal_device_get_property_string (ctx, udi2,
"volume.mount_point", NULL);
-
+
if (is_ipod (mount_point))
{
goto out;
@@ -227,15 +227,15 @@ find_ipod_mount_point (LibHalContext *ctx)
out:
if (volumes != NULL)
libhal_free_string_array (volumes);
-
+
if (apple_devices != NULL)
libhal_free_string_array (apple_devices);
-
+
if (mount_point != NULL)
{
retval = g_strdup (mount_point);
libhal_free_string (mount_point);
}
-
+
return (retval);
}
diff --git a/plugins/ipod-sync/sync.c b/plugins/ipod-sync/sync.c
index 4d555b4a83..b826dca5f3 100644
--- a/plugins/ipod-sync/sync.c
+++ b/plugins/ipod-sync/sync.c
@@ -39,18 +39,18 @@ static void pulse (void)
*/
static void error_dialog (char *title, char *error)
{
- GtkWidget *error_dlg =
+ GtkWidget *error_dlg =
gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
"<span weight=\"bold\" size=\"larger\">"
"%s</span>\n\n%s.", title, error);
-
+
gtk_dialog_set_has_separator (GTK_DIALOG (error_dlg), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (error_dlg), 5);
gtk_label_set_use_markup (GTK_LABEL (GTK_MESSAGE_DIALOG (error_dlg)->label),
TRUE);
gtk_dialog_set_default_response (GTK_DIALOG (error_dlg),
GTK_RESPONSE_OK);
-
+
gtk_dialog_run (GTK_DIALOG (error_dlg));
gtk_widget_destroy (error_dlg);
}
@@ -114,8 +114,8 @@ static void
force_little_endian (gunichar2 *data, int length)
{
int i;
-
- /* We're big-endian?
+
+ /* We're big-endian?
(A little tidier than before) */
if (G_BYTE_ORDER == G_BIG_ENDIAN)
{
@@ -128,7 +128,7 @@ force_little_endian (gunichar2 *data, int length)
data[i] = c;
}
- }
+ }
}
/**
@@ -147,7 +147,7 @@ write_to_ipod (GString *str, char *path, char *filename)
gunichar2 *utf16;
guchar bom[2] = {0xFF, 0xFE};
int i, count;
-
+
output_path = g_build_path (G_DIR_SEPARATOR_S,
ipod_info.mount_point,
path, NULL);
@@ -164,11 +164,11 @@ write_to_ipod (GString *str, char *path, char *filename)
output_file = g_build_filename (output_path, filename, NULL);
g_free (output_path);
-
+
f = fopen (output_file, "w");
g_free (output_file);
-
+
if (f == NULL)
{
critical_error (_("Could not export data!"), strerror (errno));
@@ -179,24 +179,24 @@ write_to_ipod (GString *str, char *path, char *filename)
if (g_utf8_validate (utf8, -1, NULL))
{
utf16 = g_utf8_to_utf16 (utf8, -1, NULL, NULL, NULL);
-
+
/* Swap the bytes if we're big-endian so that the output
* remains little-endian according to the BOM. */
force_little_endian (utf16, g_utf8_strlen (utf8, -1));
}
-
+
count = 2 * g_utf8_strlen (utf8, -1);
-
- /* Write the BOM
+
+ /* Write the BOM
* 0xFF 0xFE
* UTF-16 Little Endian
*/
for (i = 0; i < 2; i++)
fwrite (&bom[i], 1, 1, f);
-
+
if ((fwrite(utf16, count, 1, f) != 1) &&
(count > 0))
- {
+ {
g_free (utf16);
fclose (f);
critical_error (_("Could not export data!"),
@@ -217,15 +217,15 @@ uri_list_to_vcard_string (GSList *uris)
GSList *uri;
qry = e_book_query_field_exists (E_CONTACT_FILE_AS);
-
+
str = g_string_new (NULL);
-
+
for (uri = uris; uri != NULL; uri = uri->next)
{
g_assert (uri->data != NULL);
book = e_book_new_from_uri (uri->data, NULL);
-
+
if (e_book_open (book, TRUE, NULL) == FALSE)
{
error_dialog (_("Could not open addressbook!"),
@@ -247,7 +247,7 @@ uri_list_to_vcard_string (GSList *uris)
{
gchar *tmp;
EContact *contact = E_CONTACT (c->data);
-
+
tmp = e_vcard_to_string (E_VCARD (contact),
EVC_FORMAT_VCARD_30);
@@ -259,7 +259,7 @@ uri_list_to_vcard_string (GSList *uris)
if (contacts != NULL)
g_list_free (contacts);
-
+
g_object_unref (book);
}
@@ -277,7 +277,7 @@ uri_list_to_vcal_string (GSList *uris, ECalSourceType type)
icalcomponent *obj = NULL;
GList *objects = NULL, *o = NULL;
GSList *uri;
-
+
str = g_string_new (NULL);
for (uri = uris; uri != NULL; uri = uri->next)
@@ -285,7 +285,7 @@ uri_list_to_vcal_string (GSList *uris, ECalSourceType type)
g_assert (uri->data != NULL);
cal = e_cal_new_from_uri (uri->data, type);
-
+
if (e_cal_open (cal, TRUE, NULL) == FALSE)
{
error_dialog (_("Could not open calendar/todo!"),
@@ -295,14 +295,14 @@ uri_list_to_vcal_string (GSList *uris, ECalSourceType type)
continue;
}
-
+
e_cal_get_object_list (cal, "#t", &objects, NULL);
for (o = objects; o != NULL; o = o->next)
{
gchar *tmp;
icalcomponent *comp;
-
+
g_assert (o->data != NULL);
comp = o->data;
@@ -310,7 +310,7 @@ uri_list_to_vcal_string (GSList *uris, ECalSourceType type)
g_string_append (str, tmp);
g_free (tmp);
}
-
+
g_object_unref (cal);
}
@@ -326,15 +326,15 @@ export_addressbook (void)
GSList *uris;
GString *data;
pulse ();
-
+
uris = get_source_uris_for_type (EBOOK_SOURCE_LIST);
pulse ();
-
+
data = uri_list_to_vcard_string (uris);
write_to_ipod (data, "/Contacts/", "evolution.vcf");
-
+
g_string_free (data, TRUE);
pulse ();
@@ -360,11 +360,11 @@ export_calendar (void)
data = uri_list_to_vcal_string (uris, E_CAL_SOURCE_TYPE_EVENT);
write_to_ipod (data, "/Calendars/", "evolution-cal.ics");
-
+
g_string_free (data, TRUE);
free_uri_list (uris);
-
+
pulse ();
}
@@ -388,7 +388,7 @@ export_tasks (void)
g_string_free (data, TRUE);
free_uri_list (uris);
-
+
pulse ();
}
@@ -396,13 +396,13 @@ void
export_to_ipod (void)
{
pulse ();
-
+
if (ipod_info.addressbook == TRUE)
export_addressbook ();
if (ipod_info.calendar == TRUE)
export_calendar ();
-
+
if (ipod_info.tasks == TRUE)
export_tasks ();