Commit f143a2f5 authored by Maurice van der Pot's avatar Maurice van der Pot

Major trailing white space removal

Use the --whitespace=fix option when rebasing to master for the first
time after this commit to prevent conflicts with your own commits.
parent bc5d4457
This diff is collapsed.
......@@ -53,7 +53,7 @@ struct _ECalBackendPlanner {
};
struct _ECalBackendPlannerClass {
ECalBackendSyncClass parent_class;
ECalBackendSyncClass parent_class;
MrpApplication *mrp_app;
};
......
......@@ -38,16 +38,16 @@
static GConfClient *conf_client;
static GMainLoop *main_loop;
void org_gnome_planner_source_add (EPlugin *epl,
void org_gnome_planner_source_add (EPlugin *epl,
EConfigHookItemFactoryData *data);
/* From mrp-project.c */
static const gchar *
static const gchar *
uri_peek_file_name (const gchar *uri)
{
const gchar *name;
size_t len;
len = strlen (uri);
if (len > 3 && !strstr (uri, ":/")) {
/* No protocol. */
......@@ -63,7 +63,7 @@ uri_peek_file_name (const gchar *uri)
}
static void
add_planner_file (const gchar *uri)
add_planner_file (const gchar *uri)
{
ESourceList *source_list;
ESourceGroup *group;
......@@ -108,7 +108,7 @@ add_planner_file (const gchar *uri)
}
void
org_gnome_planner_source_add (EPlugin *epl,
org_gnome_planner_source_add (EPlugin *epl,
EConfigHookItemFactoryData *data)
{
GtkWidget *widget;
......@@ -132,7 +132,7 @@ org_gnome_planner_source_add (EPlugin *epl,
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
dest_uri = gtk_file_chooser_get_uri
dest_uri = gtk_file_chooser_get_uri
(GTK_FILE_CHOOSER (dialog));
}
......@@ -141,15 +141,15 @@ org_gnome_planner_source_add (EPlugin *epl,
gtk_widget_destroy (dialog);
return;
}
tmp = strstr (dest_uri, planner_ext);
if (tmp && *(tmp + strlen (planner_ext)) == '\0') {
proceed = TRUE;
} else {
GtkWidget *warning =
GtkWidget *warning =
gtk_message_dialog_new (NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
......@@ -163,11 +163,11 @@ org_gnome_planner_source_add (EPlugin *epl,
}
gtk_widget_destroy (warning);
}
/* Time to add the new source */
if (proceed) {
add_planner_file (dest_uri);
}
gtk_widget_destroy (dialog);
g_free (dest_uri);
gtk_widget_destroy (dialog);
g_free (dest_uri);
}
......@@ -30,8 +30,8 @@ static GMainLoop *main_loop;
static char *planner_file;
static void
add_planner_file (const gchar *conf_key,
const gchar *uri)
add_planner_file (const gchar *conf_key,
const gchar *uri)
{
ESourceList *source_list;
ESourceGroup *group;
......
......@@ -83,7 +83,7 @@ egg_recent_item_unref (EggRecentItem *item)
}
EggRecentItem *
EggRecentItem *
egg_recent_item_new_from_uri (const gchar *uri)
{
EggRecentItem *item;
......@@ -96,7 +96,7 @@ egg_recent_item_new_from_uri (const gchar *uri)
egg_recent_item_free (item);
return NULL;
}
item->mime_type = gnome_vfs_get_mime_type (item->uri);
if (!item->mime_type)
......@@ -211,19 +211,19 @@ egg_recent_item_set_uri (EggRecentItem *item, const gchar *uri)
return TRUE;
}
gchar *
gchar *
egg_recent_item_get_uri (const EggRecentItem *item)
{
return g_strdup (item->uri);
}
G_CONST_RETURN gchar *
G_CONST_RETURN gchar *
egg_recent_item_peek_uri (const EggRecentItem *item)
{
return item->uri;
}
gchar *
gchar *
egg_recent_item_get_uri_utf8 (const EggRecentItem *item)
{
/* this could fail, but it's not likely, since we've already done it
......@@ -331,19 +331,19 @@ egg_recent_item_get_short_name (const EggRecentItem *item)
return short_name;
}
void
void
egg_recent_item_set_mime_type (EggRecentItem *item, const gchar *mime)
{
item->mime_type = g_strdup (mime);
}
gchar *
gchar *
egg_recent_item_get_mime_type (const EggRecentItem *item)
{
return g_strdup (item->mime_type);
}
void
void
egg_recent_item_set_timestamp (EggRecentItem *item, time_t timestamp)
{
if (timestamp == (time_t) -1)
......@@ -352,7 +352,7 @@ egg_recent_item_set_timestamp (EggRecentItem *item, time_t timestamp)
item->timestamp = timestamp;
}
time_t
time_t
egg_recent_item_get_timestamp (const EggRecentItem *item)
{
return item->timestamp;
......@@ -372,13 +372,13 @@ egg_recent_item_in_group (const EggRecentItem *item, const gchar *group_name)
tmp = item->groups;
while (tmp != NULL) {
gchar *val = (gchar *)tmp->data;
if (strcmp (group_name, val) == 0)
return TRUE;
tmp = tmp->next;
}
return FALSE;
}
......@@ -401,7 +401,7 @@ egg_recent_item_remove_group (EggRecentItem *item, const gchar *group_name)
tmp = item->groups;
while (tmp != NULL) {
gchar *val = (gchar *)tmp->data;
if (strcmp (group_name, val) == 0) {
item->groups = g_list_remove (item->groups,
val);
......@@ -429,12 +429,12 @@ GType
egg_recent_item_get_type (void)
{
static GType boxed_type = 0;
if (!boxed_type) {
boxed_type = g_boxed_type_register_static ("EggRecentItem",
(GBoxedCopyFunc)egg_recent_item_ref,
(GBoxedFreeFunc)egg_recent_item_unref);
}
return boxed_type;
}
......@@ -25,7 +25,7 @@ struct _EggRecentItem {
gboolean private_data;
GList *groups;
int refcount;
};
......
......@@ -159,11 +159,11 @@ egg_recent_model_string_match (const GSList *list, const gchar *str)
return TRUE;
tmp = list;
while (tmp) {
if (g_pattern_match_string (tmp->data, str))
return TRUE;
tmp = tmp->next;
}
......@@ -358,7 +358,7 @@ start_element_handler (GMarkupParseContext *context,
egg_recent_item_set_private (info->current_item, TRUE);
} else if (ELEMENT_IS (TAG_GROUPS))
push_state (info, STATE_GROUPS);
else if (ELEMENT_IS (TAG_GROUP))
else if (ELEMENT_IS (TAG_GROUP))
push_state (info, STATE_GROUP);
}
......@@ -437,7 +437,7 @@ text_handler (GMarkupParseContext *context,
text);
break;
}
}
static void
......@@ -478,7 +478,7 @@ egg_recent_model_sort (EggRecentModel *model, GList *list)
switch (model->priv->sort_type) {
case EGG_RECENT_MODEL_SORT_MRU:
list = g_list_sort (list,
(GCompareFunc)list_compare_func_mru);
(GCompareFunc)list_compare_func_mru);
break;
case EGG_RECENT_MODEL_SORT_LRU:
list = g_list_sort (list,
......@@ -557,7 +557,7 @@ egg_recent_model_filter (EggRecentModel *model,
if (pass_mime_test && pass_group_test &&
model->priv->scheme_filter_values != NULL) {
gchar *scheme;
scheme = gnome_vfs_get_uri_scheme (uri);
if (egg_recent_model_string_match
......@@ -579,7 +579,7 @@ egg_recent_model_filter (EggRecentModel *model,
g_list_free (list);
}
return newlist;
}
......@@ -618,7 +618,7 @@ egg_recent_model_monitor_list (EggRecentModel *model, GList *list)
gchar *uri;
tmp = tmp->next;
uri = egg_recent_item_get_uri (item);
if (g_hash_table_lookup (model->priv->monitors, uri)) {
/* already monitoring this one */
......@@ -630,7 +630,7 @@ egg_recent_model_monitor_list (EggRecentModel *model, GList *list)
GNOME_VFS_MONITOR_FILE,
egg_recent_model_monitor_list_cb,
model);
if (res == GNOME_VFS_OK)
g_hash_table_insert (model->priv->monitors, uri, handle);
else
......@@ -729,9 +729,9 @@ egg_recent_model_read (EggRecentModel *model, FILE *file)
}
parse_info_init (&info);
ctx = g_markup_parse_context_new (&parser, 0, &info, NULL);
error = NULL;
if (!g_markup_parse_context_parse (ctx, content, strlen (content),
&error)) {
......@@ -744,7 +744,7 @@ egg_recent_model_read (EggRecentModel *model, FILE *file)
error = NULL;
if (!g_markup_parse_context_end_parse (ctx, &error))
goto out;
g_markup_parse_context_free (ctx);
out:
list = info.items;
......@@ -770,7 +770,7 @@ egg_recent_model_write (EggRecentModel *model, FILE *file, GList *list)
const GList *groups;
int i;
int ret;
string = g_string_new ("<?xml version=\"1.0\"?>\n");
string = g_string_append (string, "<" TAG_RECENT_FILES ">\n");
......@@ -790,7 +790,7 @@ egg_recent_model_write (EggRecentModel *model, FILE *file, GList *list)
mime_type = egg_recent_item_get_mime_type (item);
timestamp = egg_recent_item_get_timestamp (item);
string = g_string_append (string, " <" TAG_RECENT_ITEM ">\n");
g_string_append_printf (string,
......@@ -803,7 +803,7 @@ egg_recent_model_write (EggRecentModel *model, FILE *file, GList *list)
g_string_append_printf (string,
" <" TAG_MIME_TYPE "></" TAG_MIME_TYPE ">\n");
g_string_append_printf (string,
" <" TAG_TIMESTAMP ">%d</" TAG_TIMESTAMP ">\n", (int)timestamp);
......@@ -819,7 +819,7 @@ egg_recent_model_write (EggRecentModel *model, FILE *file, GList *list)
if (groups == NULL && egg_recent_item_get_private (item))
g_warning ("Item with URI \"%s\" marked as private, but"
" does not belong to any groups.\n", uri);
while (groups) {
const gchar *group = (const gchar *)groups->data;
gchar *escaped_group;
......@@ -834,7 +834,7 @@ egg_recent_model_write (EggRecentModel *model, FILE *file, GList *list)
groups = groups->next;
}
string = g_string_append (string, " </" TAG_GROUPS ">\n");
string = g_string_append (string,
......@@ -863,7 +863,7 @@ egg_recent_model_open_file (EggRecentModel *model)
{
FILE *file;
mode_t prev_umask;
file = fopen (model->priv->path, "r+");
if (file == NULL) {
/* be paranoid */
......@@ -889,13 +889,13 @@ egg_recent_model_lock_file (FILE *file)
fd = fileno (file);
/* Attempt to lock the file 5 times,
* waiting a random interval (< 1 second)
* waiting a random interval (< 1 second)
* in between attempts.
* We should really be doing asynchronous
* locking, but requires substantially larger
* changes.
*/
while (try > 0)
{
int rand_interval;
......@@ -904,7 +904,7 @@ egg_recent_model_lock_file (FILE *file)
return TRUE;
rand_interval = 1 + (int) (10.0 * rand()/(RAND_MAX + 1.0));
g_usleep (100000 * rand_interval);
--try;
......@@ -964,7 +964,7 @@ egg_recent_model_finalize (GObject *object)
g_free (model->priv->path);
model->priv->path = NULL;
g_hash_table_destroy (model->priv->monitors);
model->priv->monitors = NULL;
......@@ -1067,14 +1067,14 @@ egg_recent_model_class_init (EggRecentModelClass * klass)
G_TYPE_NONE, 1,
G_TYPE_POINTER);
g_object_class_install_property (object_class,
PROP_MIME_FILTERS,
g_param_spec_pointer ("mime-filters",
"Mime Filters",
"List of mime types to be allowed.",
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_GROUP_FILTERS,
g_param_spec_pointer ("group-filters",
......@@ -1155,7 +1155,7 @@ egg_recent_model_init (EggRecentModel * model)
g_warning ("gnome-vfs initialization failed.");
return;
}
model->priv = g_new0 (EggRecentModelPrivate, 1);
......@@ -1165,7 +1165,7 @@ egg_recent_model_init (EggRecentModel * model)
model->priv->mime_filter_values = NULL;
model->priv->group_filter_values = NULL;
model->priv->scheme_filter_values = NULL;
model->priv->client = gconf_client_get_default ();
gconf_client_add_dir (model->priv->client, EGG_RECENT_MODEL_KEY_DIR,
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
......@@ -1186,7 +1186,7 @@ egg_recent_model_init (EggRecentModel * model)
model->priv->client,
EGG_RECENT_MODEL_EXPIRE_KEY,
NULL);
#if 0
/* keep this out, for now */
model->priv->limit = gconf_client_get_int (
......@@ -1247,7 +1247,7 @@ egg_recent_model_add_full (EggRecentModel * model, EggRecentItem *item)
gboolean updated = FALSE;
char *uri;
time_t t;
g_return_val_if_fail (model != NULL, FALSE);
g_return_val_if_fail (EGG_IS_RECENT_MODEL (model), FALSE);
......@@ -1374,7 +1374,7 @@ egg_recent_model_delete (EggRecentModel * model, const gchar * uri)
length = g_list_length (list);
list = egg_recent_model_delete_from_list (list, uri);
if (length == g_list_length (list)) {
/* nothing was deleted */
EGG_RECENT_ITEM_LIST_UNREF (list);
......@@ -1390,7 +1390,7 @@ egg_recent_model_delete (EggRecentModel * model, const gchar * uri)
}
out:
if (!egg_recent_model_unlock_file (file))
g_warning ("Failed to unlock: %s", strerror (errno));
......@@ -1425,10 +1425,10 @@ egg_recent_model_get_list (EggRecentModel *model)
file = egg_recent_model_open_file (model);
g_return_val_if_fail (file != NULL, NULL);
if (egg_recent_model_lock_file (file)) {
list = egg_recent_model_read (model, file);
} else {
g_warning ("Failed to lock: %s", strerror (errno));
fclose (file);
......@@ -1475,7 +1475,7 @@ egg_recent_model_set_limit (EggRecentModel *model, int limit)
* egg_recent_model_get_limit:
* @model: A EggRecentModel object.
*
* This function gets the maximum length of the list.
* This function gets the maximum length of the list.
*
* Returns: int
*/
......@@ -1651,7 +1651,7 @@ egg_recent_model_set_sort (EggRecentModel *model,
EggRecentModelSort sort)
{
g_return_if_fail (model != NULL);
model->priv->sort_type = sort;
}
......@@ -1671,7 +1671,7 @@ egg_recent_model_changed (EggRecentModel *model)
if (model->priv->limit > 0) {
list = egg_recent_model_get_list (model);
/* egg_recent_model_monitor_list (model, list); */
g_signal_emit (G_OBJECT (model), model_signals[CHANGED], 0,
list);
}
......@@ -1726,10 +1726,10 @@ egg_recent_model_remove_expired (EggRecentModel *model)
file = egg_recent_model_open_file (model);
g_return_if_fail (file != NULL);
if (egg_recent_model_lock_file (file)) {
list = egg_recent_model_read (model, file);
} else {
g_warning ("Failed to lock: %s", strerror (errno));
return;
......
......@@ -23,7 +23,7 @@ struct _EggRecentModel {
struct _EggRecentModelClass {
GObjectClass parent_class;
void (*changed) (EggRecentModel *model, GList *list);
};
......
......@@ -15,7 +15,7 @@
#define EGG_RECENT_UTIL_HOSTNAME_SIZE 512
/* ripped out of gedit2 */
gchar*
gchar*
egg_recent_util_escape_underlines (const gchar* text)
{
GString *str;
......@@ -66,8 +66,8 @@ load_icon_file (char *filename,
if (pixbuf == NULL) {
return NULL;
}
width = gdk_pixbuf_get_width (pixbuf);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
/* if the icon is larger than the nominal size, scale down */
if (MAX (width, height) > nominal_size) {
......@@ -95,10 +95,10 @@ egg_recent_util_get_icon (GnomeIconTheme *theme, const gchar *uri,
gchar *filename;
const GnomeIconData *icon_data;
GdkPixbuf *pixbuf;
icon = gnome_icon_lookup (theme, NULL, uri, NULL, NULL,
mime_type, 0, NULL);
g_return_val_if_fail (icon != NULL, NULL);
......@@ -114,8 +114,8 @@ egg_recent_util_get_icon (GnomeIconTheme *theme, const gchar *uri,
pixbuf = load_icon_file (filename, size);
g_free (filename);
return pixbuf;
}
#endif /* !USE_STABLE_LIBGNOMEUI */
......@@ -127,9 +127,9 @@ egg_recent_util_get_unique_id (void)
time_t the_time;
guint32 rand;
int pid;
gethostname (hostname, EGG_RECENT_UTIL_HOSTNAME_SIZE);
time (&the_time);
rand = g_random_int ();
pid = getpid ();
......
......@@ -22,7 +22,7 @@
Boston, MA 02111-1307, USA.
Authors: Ettore Perazzoli <ettore@comm2000.it>
John Sullivan <sullivan@eazel.com>
John Sullivan <sullivan@eazel.com>
Darin Adler <darin@eazel.com>
*/
......@@ -143,7 +143,7 @@ uri_is_local_scheme (const char *uri)
char *temp_scheme;
int i;
char *local_schemes[] = {"file:", "help:", "ghelp:", "gnome-help:",
"trash:", "man:", "info:",
"trash:", "man:", "info:",
"hardware:", "search:", "pipe:",
"gnome-trash:", NULL};
......@@ -208,7 +208,7 @@ handle_trailing_slashes (const char *uri)
/* go back till you remove them all but one. */
for (temp--; *(temp - 1) == '/'; temp--) {
*temp = '\0';
}
}
}
}
......@@ -235,7 +235,7 @@ make_uri_canonical (const char *uri)
return NULL;
}
/* FIXME bugzilla.eazel.com 648:
/* FIXME bugzilla.eazel.com 648:
* This currently ignores the issue of two uris that are not identical but point
* to the same data except for the specific cases of trailing '/' characters,
* file:/ and file:///, and "lack of file:".
......@@ -256,9 +256,9 @@ make_uri_canonical (const char *uri)
old_uri = canonical_uri;
if (old_uri[0] != '/') {
/* FIXME bugzilla.eazel.com 5069:
/* FIXME bugzilla.eazel.com 5069:
* bandaid alert. Is this really the right thing to do?
*
*
* We got what really is a relative path. We do a little bit of
* a stretch here and assume it was meant to be a cryptic absolute path,
* and convert it to one. Since we can't call gnome_vfs_uri_new and
......@@ -291,7 +291,7 @@ make_uri_canonical (const char *uri)
canonical_uri = old_uri;
}
}
/* FIXME bugzilla.eazel.com 2802:
* Work around gnome-vfs's desire to convert file:foo into file://foo
* by converting to file:///foo here. When you remove this, check that
......@@ -319,7 +319,7 @@ format_uri_for_display (const char *uri, gboolean filenames_are_locale_encoded)
/* If there's no fragment and it's a local path. */
path = gnome_vfs_get_local_path_from_uri (canonical_uri);
if (path != NULL) {
if (filenames_are_locale_encoded) {
utf8_path = g_locale_to_utf8 (path, -1, NULL, NULL, NULL);
......@@ -327,7 +327,7 @@ format_uri_for_display (const char *uri, gboolean filenames_are_locale_encoded)
g_free (canonical_uri);
g_free (path);
return utf8_path;
}
}
} else if (g_utf8_validate (path, -1, NULL)) {
g_free (canonical_uri);
return path;
......@@ -348,7 +348,7 @@ char *
egg_recent_vfs_format_uri_for_display (const char *uri)
{
static gboolean broken_filenames;
broken_filenames = g_getenv ("G_BROKEN_FILENAMES") != NULL;
return format_uri_for_display (uri, broken_filenames);
......@@ -388,7 +388,7 @@ escape_high_chars (const guchar *string)
static const gchar hex[16] = "0123456789ABCDEF";
#define ACCEPTABLE(a) ((a)>=32 && (a)<128)
escape_count = 0;
if (string == NULL) {
......@@ -400,7 +400,7 @@ escape_high_chars (const guchar *string)
escape_count++;
}
}
if (escape_count == 0) {
return g_strdup (string);
}
......@@ -414,7 +414,7 @@ escape_high_chars (const guchar *string)
*result_scanner++ = '%';
*result_scanner++ = hex[*scanner >> 4];
*result_scanner++ = hex[*scanner & 15];
} else {
*result_scanner++ = *scanner;
}
......@@ -495,7 +495,7 @@ make_uri_from_input_internal (const char *text,
g_free (stripped);
return uri;
}