aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/cal-backend-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/pcs/cal-backend-file.c')
-rw-r--r--calendar/pcs/cal-backend-file.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index 97e96d3d44..715e1e70bc 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -183,29 +183,21 @@ save (CalBackendFile *cbfile)
g_assert (priv->icalcomp != NULL);
/* Make a backup copy of the file if it exists */
- if (gnome_vfs_uri_exists (priv->uri)) {
- tmp = gnome_vfs_uri_to_string (priv->uri, GNOME_VFS_URI_HIDE_NONE);
- if (tmp) {
- GnomeVFSURI *backup_uri;
- gchar *backup_uristr;
-
- backup_uristr = g_strconcat (tmp, "~", NULL);
- backup_uri = gnome_vfs_uri_new (backup_uristr);
-
- result = gnome_vfs_move_uri (priv->uri, backup_uri, TRUE);
- gnome_vfs_uri_unref (backup_uri);
-
- g_free (tmp);
- g_free (backup_uristr);
- }
- } else {
- result = GNOME_VFS_OK;
+ tmp = gnome_vfs_uri_to_string (priv->uri, GNOME_VFS_URI_HIDE_NONE);
+ if (tmp) {
+ GnomeVFSURI *backup_uri;
+ gchar *backup_uristr;
+
+ backup_uristr = g_strconcat (tmp, "~", NULL);
+ backup_uri = gnome_vfs_uri_new (backup_uristr);
+
+ result = gnome_vfs_move_uri (priv->uri, backup_uri, TRUE);
+ gnome_vfs_uri_unref (backup_uri);
+
+ g_free (tmp);
+ g_free (backup_uristr);
}
-
- if (result != GNOME_VFS_OK)
- goto error;
-
/* Now write the new file out */
result = gnome_vfs_create_uri (&handle, priv->uri,
GNOME_VFS_OPEN_WRITE,
@@ -616,9 +608,6 @@ cal_backend_file_load (CalBackend *backend, GnomeVFSURI *uri)
if (!gnome_vfs_uri_is_local (uri))
return CAL_BACKEND_LOAD_ERROR;
- if (!gnome_vfs_uri_exists (uri))
- return CAL_BACKEND_LOAD_ERROR;;
-
str_uri = gnome_vfs_uri_to_string (uri,
(GNOME_VFS_URI_HIDE_USER_NAME
| GNOME_VFS_URI_HIDE_PASSWORD
@@ -659,7 +648,7 @@ cal_backend_file_load (CalBackend *backend, GnomeVFSURI *uri)
/* Clean up */
if (priv->uri)
- gnome_vfs_uri_unref (uri);
+ gnome_vfs_uri_unref (priv->uri);
gnome_vfs_uri_ref (uri);
priv->uri = uri;