aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/save-calendar
diff options
context:
space:
mode:
authorPhilip Van Hoof <pvanhoof@gnome.org>2005-03-02 23:56:23 +0800
committerPhilip Van Hoof <pvanhoof@src.gnome.org>2005-03-02 23:56:23 +0800
commit43f8824655767ffa75a94114be9e893353464cf3 (patch)
tree94f7cbc52a4e5270e408b6ac235e8133e69460ea /plugins/save-calendar
parentb72fc2eca390d5c032d5932e964ed519504b3b65 (diff)
downloadgsoc2013-evolution-43f8824655767ffa75a94114be9e893353464cf3.tar
gsoc2013-evolution-43f8824655767ffa75a94114be9e893353464cf3.tar.gz
gsoc2013-evolution-43f8824655767ffa75a94114be9e893353464cf3.tar.bz2
gsoc2013-evolution-43f8824655767ffa75a94114be9e893353464cf3.tar.lz
gsoc2013-evolution-43f8824655767ffa75a94114be9e893353464cf3.tar.xz
gsoc2013-evolution-43f8824655767ffa75a94114be9e893353464cf3.tar.zst
gsoc2013-evolution-43f8824655767ffa75a94114be9e893353464cf3.zip
Fixes for Bug #73099 and Bug #73098 Changed malloc to g_malloc and char to
2005-03-02 Philip Van Hoof <pvanhoof@gnome.org> * rdf-format.c: Fixes for Bug #73099 and Bug #73098 * csv-format.c: Changed malloc to g_malloc and char to gchar svn path=/trunk/; revision=28937
Diffstat (limited to 'plugins/save-calendar')
-rw-r--r--plugins/save-calendar/ChangeLog5
-rw-r--r--plugins/save-calendar/csv-format.c4
-rw-r--r--plugins/save-calendar/rdf-format.c25
3 files changed, 22 insertions, 12 deletions
diff --git a/plugins/save-calendar/ChangeLog b/plugins/save-calendar/ChangeLog
index e9c35b06c3..a34d307635 100644
--- a/plugins/save-calendar/ChangeLog
+++ b/plugins/save-calendar/ChangeLog
@@ -1,5 +1,10 @@
2005-03-02 Philip Van Hoof <pvanhoof@gnome.org>
+ * rdf-format.c: Fixes for Bug #73099 and Bug #73098
+ * csv-format.c: Changed malloc to g_malloc and char to gchar
+
+2005-03-02 Philip Van Hoof <pvanhoof@gnome.org>
+
* csv-format.c: Fixes for Bug #73099 and Bug #73098
2005-02-24 Björn Torkelsson <torkel@acc.umu.se>
diff --git a/plugins/save-calendar/csv-format.c b/plugins/save-calendar/csv-format.c
index 4f10d14a2a..e414571af8 100644
--- a/plugins/save-calendar/csv-format.c
+++ b/plugins/save-calendar/csv-format.c
@@ -161,7 +161,7 @@ add_time_to_csv (GString *line, icaltimetype *time, CsvConfig *config)
if (time) {
gboolean needquotes = FALSE;
struct tm mytm = icaltimetype_to_tm (time);
- char *str = (char*) malloc (sizeof (char) * 200);
+ gchar *str = (char*) g_malloc (sizeof (char) * 200);
/*
* Translator: the %F %T is the thirth argument for a strftime function.
@@ -179,7 +179,7 @@ add_time_to_csv (GString *line, icaltimetype *time, CsvConfig *config)
if (needquotes)
line = g_string_append (line, config->quote);
- free (str);
+ g_free (str);
}
diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c
index eb8154f782..268b17798a 100644
--- a/plugins/save-calendar/rdf-format.c
+++ b/plugins/save-calendar/rdf-format.c
@@ -38,6 +38,8 @@
#include <libecal/e-cal.h>
#include <calendar/gui/e-cal-popup.h>
#include <libgnomevfs/gnome-vfs.h>
+#include <libecal/e-cal-time-util.h>
+#include <libedataserver/e-util.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
@@ -61,18 +63,18 @@ add_string_to_rdf (xmlNodePtr node, const gchar *tag, const char *value);
#define CALENDAR_CONFIG_PREFIX "/apps/evolution/calendar"
#define CALENDAR_CONFIG_TIMEZONE CALENDAR_CONFIG_PREFIX "/display/timezone"
-GConfClient *config = NULL;
+static GConfClient *config = NULL;
static gchar *
calendar_config_get_timezone (void)
{
+
gchar *retval = NULL;
if (!config)
config = gconf_client_get_default ();
retval = gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL);
-
if (!retval)
retval = g_strdup ("UTC");
@@ -143,14 +145,17 @@ add_time_to_rdf (xmlNodePtr node, const gchar *tag, icaltimetype *time)
{
if (time) {
xmlNodePtr cur_node = NULL;
+ struct tm mytm = icaltimetype_to_tm (time);
+ gchar *str = (gchar*) g_malloc (sizeof (char) * 200);
gchar *tmp = NULL;
- gchar *str = g_strdup_printf ("%s%d-%s%d-%s%dT%s%d:%s%d:%s%d",
- (time->year < 10)?"0":"", time->year,
- (time->month < 10)?"0":"", time->month,
- (time->day < 10)?"0":"", time->day,
- (time->hour < 10)?"0":"", time->hour,
- (time->minute < 10)?"0":"", time->minute,
- (time->second < 10)?"0":"", time->second);
+
+ /*
+ * Translator: the %FT%T is the thirth argument for a strftime function.
+ * It lets you define the formatting of the date in the rdf-file.
+ * Also check out http://www.w3.org/2002/12/cal/tzd
+ * */
+ e_utf8_strftime (str, 200, _("%FT%T"), &mytm);
+
cur_node = xmlNewChild (node, NULL, tag, str);
/* Not sure about this property */
@@ -217,7 +222,7 @@ do_save_calendar_rdf (FormatHandler *handler, EPlugin *ep, ECalPopupTargetSource
result = gnome_vfs_open_uri (&handle, uri, GNOME_VFS_OPEN_READ);
if (result == GNOME_VFS_OK)
- doit = e_error_run(gtk_widget_get_toplevel (GTK_WIDGET (target->selector)),
+ doit = e_error_run(GTK_WINDOW(gtk_widget_get_toplevel (GTK_WIDGET (target->selector))),
E_ERROR_ASK_FILE_EXISTS_OVERWRITE, dest_uri, NULL) == GTK_RESPONSE_OK;
if (doit) {