~ubuntu-branches/debian/lenny/evolution/lenny

« back to all changes in this revision

Viewing changes to plugins/save-calendar/rdf-format.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-06-19 10:52:49 UTC
  • Revision ID: james.westby@ubuntu.com-20070619105249-g8exw8g89lmp94b6
Tags: upstream-2.11.4
ImportĀ upstreamĀ versionĀ 2.11.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
{
136
136
        if (nummeric) {
137
137
                gchar *value = g_strdup_printf ("%d", *nummeric);
138
 
                xmlNodePtr cur_node = xmlNewChild (node, NULL, tag, value);
139
 
                xmlSetProp (cur_node, "rdf:datatype", "http://www.w3.org/2001/XMLSchema#integer");
 
138
                xmlNodePtr cur_node = xmlNewChild (node, NULL, (unsigned char *)tag, (unsigned char *)value);
 
139
                xmlSetProp (cur_node, (const unsigned char *)"rdf:datatype", (const unsigned char *)"http://www.w3.org/2001/XMLSchema#integer");
140
140
                g_free (value);
141
141
        }
142
142
}
157
157
                 * */
158
158
                e_utf8_strftime (str, 200, _("%FT%T"), &mytm);
159
159
 
160
 
                cur_node = xmlNewChild (node, NULL, tag, str);
 
160
                cur_node = xmlNewChild (node, NULL, (unsigned char *)tag, (unsigned char *)str);
161
161
 
162
162
                /* Not sure about this property */
163
163
                timezone = calendar_config_get_timezone ();
164
164
                tmp = g_strdup_printf ("http://www.w3.org/2002/12/cal/tzd/%s#tz", timezone);
165
 
                xmlSetProp (cur_node, "rdf:datatype", tmp);
 
165
                xmlSetProp (cur_node, (const unsigned char *)"rdf:datatype", (unsigned char *)tmp);
166
166
                g_free (tmp);
167
167
                g_free (timezone);
168
168
                g_free (str);
175
175
{
176
176
        if (value) {
177
177
                xmlNodePtr cur_node = NULL;
178
 
                cur_node = xmlNewChild (node, NULL, tag, value);
179
 
                xmlSetProp (cur_node, "rdf:datatype", "http://www.w3.org/2001/XMLSchema#string");
 
178
                cur_node = xmlNewChild (node, NULL, (unsigned char *)tag, (unsigned char *)value);
 
179
                xmlSetProp (cur_node, (const unsigned char *)"rdf:datatype", (const unsigned char *)"http://www.w3.org/2001/XMLSchema#string");
180
180
        }
181
181
}
182
182
 
241
241
                xmlDocPtr doc = xmlNewDoc((xmlChar *) "1.0");
242
242
                xmlNodePtr fnode = doc->children;
243
243
 
244
 
                doc->children = xmlNewDocNode (doc, NULL, "rdf:RDF", NULL);
245
 
                xmlSetProp (doc->children, "xmlns:rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
246
 
                xmlSetProp (doc->children, "xmlns", "http://www.w3.org/2002/12/cal/ical#");
 
244
                doc->children = xmlNewDocNode (doc, NULL, (const unsigned char *)"rdf:RDF", NULL);
 
245
                xmlSetProp (doc->children, (const unsigned char *)"xmlns:rdf", (const unsigned char *)"http://www.w3.org/1999/02/22-rdf-syntax-ns#");
 
246
                xmlSetProp (doc->children, (const unsigned char *)"xmlns", (const unsigned char *)"http://www.w3.org/2002/12/cal/ical#");
247
247
 
248
 
                fnode = xmlNewChild (doc->children, NULL, "Vcalendar", NULL);
 
248
                fnode = xmlNewChild (doc->children, NULL, (const unsigned char *)"Vcalendar", NULL);
249
249
 
250
250
                /* Should Evolution publicise these? */
251
 
                xmlSetProp (fnode, "xmlns:x-wr", "http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#");
252
 
                xmlSetProp (fnode, "xmlns:x-lic", "http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#");
 
251
                xmlSetProp (fnode, (const unsigned char *)"xmlns:x-wr", (const unsigned char *)"http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#");
 
252
                xmlSetProp (fnode, (const unsigned char *)"xmlns:x-lic", (const unsigned char *)"http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#");
253
253
 
254
254
                /* Not sure if it's correct like this */
255
 
                xmlNewChild (fnode, NULL, "prodid", "-//" PACKAGE_STRING "//iCal 1.0//EN");
 
255
                xmlNewChild (fnode, NULL, (const unsigned char *)"prodid", (const unsigned char *)"-//" PACKAGE_STRING "//iCal 1.0//EN");
256
256
 
257
257
                /* Assuming GREGORIAN is the only supported calendar scale */
258
 
                xmlNewChild (fnode, NULL, "calscale", "GREGORIAN");
 
258
                xmlNewChild (fnode, NULL, (const unsigned char *)"calscale", (const unsigned char *)"GREGORIAN");
259
259
 
260
260
                temp = calendar_config_get_timezone ();
261
 
                xmlNewChild (fnode, NULL, "x-wr:timezone", temp);
 
261
                xmlNewChild (fnode, NULL, (const unsigned char *)"x-wr:timezone", (unsigned char *)temp);
262
262
                g_free (temp);
263
263
 
264
 
                xmlNewChild (fnode, NULL, "method", "PUBLISH");
265
 
 
266
 
                xmlNewChild (fnode, NULL, "x-wr:relcalid", e_source_peek_uid (primary_source));
267
 
 
268
 
                xmlNewChild (fnode, NULL, "x-wr:calname", e_source_peek_name (primary_source));
 
264
                xmlNewChild (fnode, NULL, (const unsigned char *)"method", (const unsigned char *)"PUBLISH");
 
265
 
 
266
                xmlNewChild (fnode, NULL, (const unsigned char *)"x-wr:relcalid", (unsigned char *)e_source_peek_uid (primary_source));
 
267
 
 
268
                xmlNewChild (fnode, NULL, (const unsigned char *)"x-wr:calname", (unsigned char *)e_source_peek_name (primary_source));
269
269
 
270
270
                /* Version of this RDF-format */
271
 
                xmlNewChild (fnode, NULL, "version", "2.0");
 
271
                xmlNewChild (fnode, NULL, (const unsigned char *)"version", (const unsigned char *)"2.0");
272
272
 
273
273
                while (objects != NULL) {
274
274
                        ECalComponent *comp = objects->data;
279
279
                        struct icaltimetype *temp_time;
280
280
                        int *temp_int;
281
281
                        ECalComponentText temp_comptext; 
282
 
                        xmlNodePtr c_node = xmlNewChild (fnode, NULL, "component", NULL);
283
 
                        xmlNodePtr node = xmlNewChild (c_node, NULL, "Vevent", NULL);
 
282
                        xmlNodePtr c_node = xmlNewChild (fnode, NULL, (const unsigned char *)"component", NULL);
 
283
                        xmlNodePtr node = xmlNewChild (c_node, NULL, (const unsigned char *)"Vevent", NULL);
284
284
 
285
285
                        /* Getting the stuff */
286
286
                        e_cal_component_get_uid (comp, &temp_constchar);
287
287
                        tmp_str = g_strdup_printf ("#%s", temp_constchar);
288
 
                        xmlSetProp (node, "about", tmp_str);
 
288
                        xmlSetProp (node, (const unsigned char *)"about", (unsigned char *)tmp_str);
289
289
                        g_free (tmp_str);
290
290
                        add_string_to_rdf (node, "uid",temp_constchar);
291
291