aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/publish-calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-27 23:13:25 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-29 00:13:23 +0800
commitfad4af8a3d4c6f50f7bcceca8d545eb17d6fd056 (patch)
treeae78be371695c3dc18847b87d3f014f985aa3a40 /plugins/publish-calendar
parent6f5464f34ceec9e5701e3e3e651a40f9e6b3a072 (diff)
downloadgsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.gz
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.bz2
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.lz
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.xz
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.zst
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.zip
Prefer GLib basic types over C types.
Diffstat (limited to 'plugins/publish-calendar')
-rw-r--r--plugins/publish-calendar/publish-calendar.c30
-rw-r--r--plugins/publish-calendar/publish-format-fb.c6
-rw-r--r--plugins/publish-calendar/publish-format-ical.c6
-rw-r--r--plugins/publish-calendar/publish-location.c82
-rw-r--r--plugins/publish-calendar/publish-location.h8
-rw-r--r--plugins/publish-calendar/url-editor-dialog.c18
6 files changed, 75 insertions, 75 deletions
diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c
index 943f0ed933..ad6e38e9f9 100644
--- a/plugins/publish-calendar/publish-calendar.c
+++ b/plugins/publish-calendar/publish-calendar.c
@@ -47,9 +47,9 @@ static gint online = 0;
static GSList *error_queue = NULL;
static GStaticMutex error_queue_lock = G_STATIC_MUTEX_INIT;
static guint error_queue_show_idle_id = 0;
-static void error_queue_add (char *descriptions, GError *error);
+static void error_queue_add (gchar *descriptions, GError *error);
-int e_plugin_lib_enable (EPlugin *ep, int enable);
+gint e_plugin_lib_enable (EPlugin *ep, gint enable);
void action_publish (EPlugin *ep, ECalMenuTargetSelect *t);
void online_state_changed (EPlugin *ep, ESEventTargetState *target);
void publish_calendar_context_activate (EPlugin *ep, ECalPopupTargetSource *target);
@@ -233,14 +233,14 @@ ask_password (GMountOperation *op, const gchar *message, const gchar *default_us
}
static void
-ask_question (GMountOperation *op, const char *message, const char *choices[])
+ask_question (GMountOperation *op, const gchar *message, const gchar *choices[])
{
/* this has been stolen from file-chooser */
GtkWidget *dialog;
- int cnt, len;
- char *primary;
- const char *secondary = NULL;
- int res;
+ gint cnt, len;
+ gchar *primary;
+ const gchar *secondary = NULL;
+ gint res;
primary = strstr (message, "\n");
if (primary) {
@@ -452,7 +452,7 @@ url_list_changed (PublishUIData *ui)
valid = gtk_tree_model_get_iter_first (model, &iter);
while (valid) {
EPublishUri *url;
- char *xml;
+ gchar *xml;
gtk_tree_model_get (model, &iter, URL_LIST_URL_COLUMN, &url, -1);
@@ -469,7 +469,7 @@ url_list_changed (PublishUIData *ui)
static void
url_list_enable_toggled (GtkCellRendererToggle *renderer,
- const char *path_string,
+ const gchar *path_string,
PublishUIData *ui)
{
GtkTreeSelection *selection;
@@ -618,7 +618,7 @@ url_remove_clicked (GtkButton *button, PublishUIData *ui)
gtk_widget_destroy (confirm);
if (response == GTK_RESPONSE_YES) {
- int len;
+ gint len;
guint id;
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
@@ -685,7 +685,7 @@ publish_calendar_locations (EPlugin *epl, EConfigHookItemFactoryData *data)
GSList *l;
GtkTreeIter iter;
GConfClient *client;
- char *gladefile;
+ gchar *gladefile;
gladefile = g_build_filename (EVOLUTION_GLADEDIR,
"publish-calendar.glade",
@@ -806,8 +806,8 @@ publish_uris_set_timeout (GSList *uris)
g_slist_free (uris);
}
-int
-e_plugin_lib_enable (EPlugin *ep, int enable)
+gint
+e_plugin_lib_enable (EPlugin *ep, gint enable)
{
GSList *uris;
GConfClient *client;
@@ -831,7 +831,7 @@ e_plugin_lib_enable (EPlugin *ep, int enable)
}
struct eq_data {
- char *description;
+ gchar *description;
GError *error;
};
@@ -899,7 +899,7 @@ error_queue_show_idle (gpointer user_data)
}
void
-error_queue_add (char *description, GError *error)
+error_queue_add (gchar *description, GError *error)
{
struct eq_data *data;
diff --git a/plugins/publish-calendar/publish-format-fb.c b/plugins/publish-calendar/publish-format-fb.c
index b28444458e..01b4e7a926 100644
--- a/plugins/publish-calendar/publish-format-fb.c
+++ b/plugins/publish-calendar/publish-format-fb.c
@@ -33,7 +33,7 @@
#include "publish-format-fb.h"
static gboolean
-write_calendar (gchar *uid, ESourceList *source_list, GOutputStream *stream, int dur_type, int dur_value, GError **error)
+write_calendar (gchar *uid, ESourceList *source_list, GOutputStream *stream, gint dur_type, gint dur_value, GError **error)
{
ESource *source;
ECal *client = NULL;
@@ -41,7 +41,7 @@ write_calendar (gchar *uid, ESourceList *source_list, GOutputStream *stream, int
icaltimezone *utc;
time_t start = time(NULL), end;
icalcomponent *top_level;
- char *email = NULL;
+ gchar *email = NULL;
GList *users = NULL;
gboolean res = FALSE;
@@ -83,7 +83,7 @@ write_calendar (gchar *uid, ESourceList *source_list, GOutputStream *stream, int
top_level = e_cal_util_new_top_level ();
if (e_cal_get_free_busy (client, users, start, end, &objects, error)) {
- char *ical_string;
+ gchar *ical_string;
while (objects) {
ECalComponent *comp = objects->data;
diff --git a/plugins/publish-calendar/publish-format-ical.c b/plugins/publish-calendar/publish-format-ical.c
index 04e70ca8a8..f6e780daab 100644
--- a/plugins/publish-calendar/publish-format-ical.c
+++ b/plugins/publish-calendar/publish-format-ical.c
@@ -36,9 +36,9 @@ typedef struct {
} CompTzData;
static void
-insert_tz_comps (icalparameter *param, void *cb_data)
+insert_tz_comps (icalparameter *param, gpointer cb_data)
{
- const char *tzid;
+ const gchar *tzid;
CompTzData *tdata = cb_data;
icaltimezone *zone = NULL;
icalcomponent *tzcomp;
@@ -91,7 +91,7 @@ write_calendar (gchar *uid, ESourceList *source_list, GOutputStream *stream, GEr
top_level = e_cal_util_new_top_level ();
if (e_cal_get_object_list (client, "#t", &objects, error)) {
- char *ical_string;
+ gchar *ical_string;
CompTzData tdata;
tdata.zones = g_hash_table_new (g_str_hash, g_str_equal);
diff --git a/plugins/publish-calendar/publish-location.c b/plugins/publish-calendar/publish-location.c
index 71b82c8e07..98a8247725 100644
--- a/plugins/publish-calendar/publish-location.c
+++ b/plugins/publish-calendar/publish-location.c
@@ -54,12 +54,12 @@ migrateURI (const gchar *xml, xmlDocPtr doc)
uri = g_new0 (EPublishUri, 1);
root = doc->children;
- location = xmlGetProp (root, (const unsigned char *)"location");
- enabled = xmlGetProp (root, (const unsigned char *)"enabled");
- frequency = xmlGetProp (root, (const unsigned char *)"frequency");
- username = xmlGetProp (root, (const unsigned char *)"username");
+ location = xmlGetProp (root, (const guchar *)"location");
+ enabled = xmlGetProp (root, (const guchar *)"enabled");
+ frequency = xmlGetProp (root, (const guchar *)"frequency");
+ username = xmlGetProp (root, (const guchar *)"username");
- euri = e_uri_new ((const char *)location);
+ euri = e_uri_new ((const gchar *)location);
if (!euri) {
g_warning ("Could not form the uri for %s \n", location);
@@ -69,7 +69,7 @@ migrateURI (const gchar *xml, xmlDocPtr doc)
if (euri->user)
g_free (euri->user);
- euri->user = g_strdup ((const char *)username);
+ euri->user = g_strdup ((const gchar *)username);
temp = e_uri_to_string (euri, FALSE);
uri->location = g_strdup_printf ("dav://%s", strstr (temp, "//") + 2);
@@ -77,21 +77,21 @@ migrateURI (const gchar *xml, xmlDocPtr doc)
e_uri_free (euri);
if (enabled != NULL)
- uri->enabled = atoi ((char *)enabled);
+ uri->enabled = atoi ((gchar *)enabled);
if (frequency != NULL)
- uri->publish_frequency = atoi ((char *)frequency);
+ uri->publish_frequency = atoi ((gchar *)frequency);
uri->publish_format = URI_PUBLISH_AS_FB;
- password = e_passwords_get_password ("Calendar", (char *)location);
+ password = e_passwords_get_password ("Calendar", (gchar *)location);
if (password) {
- e_passwords_forget_password ("Calendar", (char *)location);
+ e_passwords_forget_password ("Calendar", (gchar *)location);
e_passwords_add_password (uri->location, password);
e_passwords_remember_password ("Calendar", uri->location);
}
for (p = root->children; p != NULL; p = p->next) {
- xmlChar *uid = xmlGetProp (p, (const unsigned char *)"uid");
- if (strcmp ((char *)p->name, "source") == 0) {
+ xmlChar *uid = xmlGetProp (p, (const guchar *)"uid");
+ if (strcmp ((gchar *)p->name, "source") == 0) {
events = g_slist_append (events, uid);
} else {
g_free (uid);
@@ -125,15 +125,15 @@ e_publish_uri_from_xml (const gchar *xml)
GSList *events = NULL;
EPublishUri *uri;
- doc = xmlParseDoc ((const unsigned char *)xml);
+ doc = xmlParseDoc ((const guchar *)xml);
if (doc == NULL)
return NULL;
root = doc->children;
- if (strcmp ((char *)root->name, "uri") != 0)
+ if (strcmp ((gchar *)root->name, "uri") != 0)
return NULL;
- if ((username = xmlGetProp (root, (const unsigned char *)"username"))) {
+ if ((username = xmlGetProp (root, (const guchar *)"username"))) {
xmlFree (username);
return migrateURI (xml, doc);
@@ -141,27 +141,27 @@ e_publish_uri_from_xml (const gchar *xml)
uri = g_new0 (EPublishUri, 1);
- location = xmlGetProp (root, (const unsigned char *)"location");
- enabled = xmlGetProp (root, (const unsigned char *)"enabled");
- frequency = xmlGetProp (root, (const unsigned char *)"frequency");
- format = xmlGetProp (root, (const unsigned char *)"format");
- publish_time = xmlGetProp (root, (const unsigned char *)"publish_time");
+ location = xmlGetProp (root, (const guchar *)"location");
+ enabled = xmlGetProp (root, (const guchar *)"enabled");
+ frequency = xmlGetProp (root, (const guchar *)"frequency");
+ format = xmlGetProp (root, (const guchar *)"format");
+ publish_time = xmlGetProp (root, (const guchar *)"publish_time");
fb_duration_value = xmlGetProp (root, (xmlChar *)"fb_duration_value");
fb_duration_type = xmlGetProp (root, (xmlChar *)"fb_duration_type");
if (location != NULL)
- uri->location = (char *)location;
+ uri->location = (gchar *)location;
if (enabled != NULL)
- uri->enabled = atoi ((char *)enabled);
+ uri->enabled = atoi ((gchar *)enabled);
if (frequency != NULL)
- uri->publish_frequency = atoi ((char *)frequency);
+ uri->publish_frequency = atoi ((gchar *)frequency);
if (format != NULL)
- uri->publish_format = atoi ((char *)format);
+ uri->publish_format = atoi ((gchar *)format);
if (publish_time != NULL)
- uri->last_pub_time = (char *)publish_time;
+ uri->last_pub_time = (gchar *)publish_time;
if (fb_duration_value)
- uri->fb_duration_value = atoi ((char *)fb_duration_value);
+ uri->fb_duration_value = atoi ((gchar *)fb_duration_value);
else
uri->fb_duration_value = -1;
@@ -170,9 +170,9 @@ e_publish_uri_from_xml (const gchar *xml)
else if (uri->fb_duration_value > 100)
uri->fb_duration_value = 100;
- if (fb_duration_type && g_str_equal ((char *)fb_duration_type, "days"))
+ if (fb_duration_type && g_str_equal ((gchar *)fb_duration_type, "days"))
uri->fb_duration_type = FB_DURATION_DAYS;
- else if (fb_duration_type && g_str_equal ((char *)fb_duration_type, "months"))
+ else if (fb_duration_type && g_str_equal ((gchar *)fb_duration_type, "months"))
uri->fb_duration_type = FB_DURATION_MONTHS;
else
uri->fb_duration_type = FB_DURATION_WEEKS;
@@ -180,8 +180,8 @@ e_publish_uri_from_xml (const gchar *xml)
uri->password = g_strdup ("");
for (p = root->children; p != NULL; p = p->next) {
- xmlChar *uid = xmlGetProp (p, (const unsigned char *)"uid");
- if (strcmp ((char *)p->name, "event") == 0) {
+ xmlChar *uid = xmlGetProp (p, (const guchar *)"uid");
+ if (strcmp ((gchar *)p->name, "event") == 0) {
events = g_slist_append (events, uid);
} else {
g_free (uid);
@@ -207,23 +207,23 @@ e_publish_uri_to_xml (EPublishUri *uri)
gchar *enabled, *frequency, *format;
GSList *calendars = NULL;
xmlChar *xml_buffer;
- char *returned_buffer;
- int xml_buffer_size;
+ gchar *returned_buffer;
+ gint xml_buffer_size;
g_return_val_if_fail (uri != NULL, NULL);
g_return_val_if_fail (uri->location != NULL, NULL);
- doc = xmlNewDoc ((const unsigned char *)"1.0");
+ doc = xmlNewDoc ((const guchar *)"1.0");
- root = xmlNewDocNode (doc, NULL, (const unsigned char *)"uri", NULL);
+ root = xmlNewDocNode (doc, NULL, (const guchar *)"uri", NULL);
enabled = g_strdup_printf ("%d", uri->enabled);
frequency = g_strdup_printf ("%d", uri->publish_frequency);
format = g_strdup_printf ("%d", uri->publish_format);
- xmlSetProp (root, (const unsigned char *)"location", (unsigned char *)uri->location);
- xmlSetProp (root, (const unsigned char *)"enabled", (unsigned char *)enabled);
- xmlSetProp (root, (const unsigned char *)"frequency", (unsigned char *)frequency);
- xmlSetProp (root, (const unsigned char *)"format", (unsigned char *)format);
- xmlSetProp (root, (const unsigned char *)"publish_time", (unsigned char *)uri->last_pub_time);
+ xmlSetProp (root, (const guchar *)"location", (guchar *)uri->location);
+ xmlSetProp (root, (const guchar *)"enabled", (guchar *)enabled);
+ xmlSetProp (root, (const guchar *)"frequency", (guchar *)frequency);
+ xmlSetProp (root, (const guchar *)"format", (guchar *)format);
+ xmlSetProp (root, (const guchar *)"publish_time", (guchar *)uri->last_pub_time);
g_free (format);
format = g_strdup_printf ("%d", uri->fb_duration_value);
@@ -238,8 +238,8 @@ e_publish_uri_to_xml (EPublishUri *uri)
for (calendars = uri->events; calendars != NULL; calendars = g_slist_next (calendars)) {
xmlNodePtr node;
- node = xmlNewChild (root, NULL, (const unsigned char *)"event", NULL);
- xmlSetProp (node, (const unsigned char *)"uid", calendars->data);
+ node = xmlNewChild (root, NULL, (const guchar *)"event", NULL);
+ xmlSetProp (node, (const guchar *)"uid", calendars->data);
}
xmlDocSetRootElement (doc, root);
diff --git a/plugins/publish-calendar/publish-location.h b/plugins/publish-calendar/publish-location.h
index a6afc2c272..a55d432a8e 100644
--- a/plugins/publish-calendar/publish-location.h
+++ b/plugins/publish-calendar/publish-location.h
@@ -34,7 +34,7 @@ enum publish_frequency {
URI_PUBLISH_MANUAL
};
-static const int publish_frequency_type_map[] = {
+static const gint publish_frequency_type_map[] = {
URI_PUBLISH_DAILY,
URI_PUBLISH_WEEKLY,
URI_PUBLISH_MANUAL,
@@ -46,7 +46,7 @@ enum publish_format {
URI_PUBLISH_AS_FB
};
-static const int publish_format_type_mask[] = {
+static const gint publish_format_type_mask[] = {
URI_PUBLISH_AS_ICAL,
URI_PUBLISH_AS_FB,
-1
@@ -67,8 +67,8 @@ struct _EPublishUri {
gchar *password;
GSList *events;
gchar *last_pub_time;
- int fb_duration_value;
- int fb_duration_type;
+ gint fb_duration_value;
+ gint fb_duration_type;
gint service_type;
};
diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c
index 08e59513e8..7456d4b193 100644
--- a/plugins/publish-calendar/url-editor-dialog.c
+++ b/plugins/publish-calendar/url-editor-dialog.c
@@ -43,7 +43,7 @@ create_uri (UrlEditorDialog *dialog)
uri->location = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->server_entry)));
} else {
const gchar *method;
- char *server, *file, *port, *username, *password;
+ gchar *server, *file, *port, *username, *password;
server = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->server_entry)));
file = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->file_entry)));
@@ -279,7 +279,7 @@ static void
set_from_uri (UrlEditorDialog *dialog)
{
EPublishUri *uri;
- char *method;
+ gchar *method;
EUri *euri = NULL;
uri = dialog->uri;
@@ -287,17 +287,17 @@ set_from_uri (UrlEditorDialog *dialog)
euri = e_uri_new (uri->location);
/* determine our method */
method = euri->protocol;
- if (strcmp ((const char *)method, "smb") == 0)
+ if (strcmp ((const gchar *)method, "smb") == 0)
uri->service_type = TYPE_SMB;
- else if (strcmp ((const char *)method, "sftp") == 0)
+ else if (strcmp ((const gchar *)method, "sftp") == 0)
uri->service_type = TYPE_SFTP;
- else if (strcmp ((const char *)method, "ftp") == 0)
+ else if (strcmp ((const gchar *)method, "ftp") == 0)
/* we set TYPE_FTP here for now. if we don't find a
* username later, we'll change it to TYPE_ANON_FTP */
uri->service_type = TYPE_FTP;
- else if (strcmp ((const char *)method, "dav") == 0)
+ else if (strcmp ((const gchar *)method, "dav") == 0)
uri->service_type = TYPE_DAV;
- else if (strcmp ((const char *)method, "davs") == 0)
+ else if (strcmp ((const gchar *)method, "davs") == 0)
uri->service_type = TYPE_DAVS;
else
uri->service_type = TYPE_URI;
@@ -309,7 +309,7 @@ set_from_uri (UrlEditorDialog *dialog)
gtk_entry_set_text (GTK_ENTRY (dialog->server_entry), euri->host);
if (euri->port) {
- char *port;
+ gchar *port;
port = g_strdup_printf ("%d", euri->port);
gtk_entry_set_text (GTK_ENTRY (dialog->port_entry), port);
g_free (port);
@@ -331,7 +331,7 @@ url_editor_dialog_construct (UrlEditorDialog *dialog)
GConfClient *gconf;
GtkSizeGroup *group;
EPublishUri *uri;
- char *gladefile;
+ gchar *gladefile;
gconf = gconf_client_get_default ();