Commit c7a0a93b authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Import the latest EggSequence which supposedly fixes a bunch of bugs.

2006-07-25  Alexander Larsson  <alexl@redhat.com>

	* cut-n-paste-code/gsequence/gsequence.[ch]:
	Import the latest EggSequence which supposedly fixes a
	bunch of bugs.

	* src/file-manager/fm-list-model.c:
	Fix to use new function names of EggSequence
parent 798ce8e7
2006-07-25 Alexander Larsson <alexl@redhat.com>
* cut-n-paste-code/gsequence/gsequence.[ch]:
Import the latest EggSequence which supposedly fixes a
bunch of bugs.
* src/file-manager/fm-list-model.c:
Fix to use new function names of EggSequence
2006-07-25 Martin Wehner <martin.wehner@gmail.com> 2006-07-25 Martin Wehner <martin.wehner@gmail.com>
* configure.in: * configure.in:
......
This diff is collapsed.
/* GLIB - Library of useful routines for C programming /* GLIB - Library of useful routines for C programming
* Copyright (C) 2002 Soeren Sandmann (sandmann@daimi.au.dk) * Copyright (C) 2002, 2003, 2004, 2005 Soeren Sandmann (sandmann@daimi.au.dk)
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -23,65 +23,118 @@ ...@@ -23,65 +23,118 @@
#define __GSEQUENCE_H__ #define __GSEQUENCE_H__
typedef struct _GSequence GSequence; typedef struct _GSequence GSequence;
typedef struct _GSequenceNode *GSequencePtr; typedef struct _GSequenceNode GSequenceIter;
typedef gint (* GSequenceIterCompareFunc) (GSequenceIter *a,
GSequenceIter *b,
gpointer data);
typedef gpointer (* GSequenceAggregateFunction) (gconstpointer before,
GSequenceIter *mid,
gconstpointer after);
/* GSequence */ /* GSequence */
GSequence * g_sequence_new (GDestroyNotify data_destroy); GSequence * g_sequence_new (GDestroyNotify data_destroy);
void g_sequence_free (GSequence *seq); void g_sequence_free (GSequence *seq);
void g_sequence_sort (GSequence *seq, gint g_sequence_get_length (GSequence *seq);
GCompareDataFunc cmp_func, void g_sequence_foreach (GSequence *seq,
gpointer cmp_data); GFunc func,
void g_sequence_append (GSequence *seq, gpointer data);
gpointer data); void g_sequence_foreach_range (GSequenceIter *begin,
void g_sequence_prepend (GSequence *seq, GSequenceIter *end,
gpointer data); GFunc func,
void g_sequence_insert (GSequencePtr ptr, gpointer data);
gpointer data); void g_sequence_sort (GSequence *seq,
void g_sequence_remove (GSequencePtr ptr); GCompareDataFunc cmp_func,
GSequencePtr g_sequence_insert_sorted (GSequence *seq, gpointer cmp_data);
gpointer data, void g_sequence_sort_iter (GSequence *seq,
GCompareDataFunc cmp_func, GSequenceIterCompareFunc cmp_func,
gpointer cmp_data); gpointer cmp_data);
void g_sequence_insert_sequence (GSequencePtr ptr,
GSequence *other_seq);
void g_sequence_concatenate (GSequence *seq1,
GSequence *seq);
void g_sequence_remove_range (GSequencePtr begin,
GSequencePtr end,
GSequence **removed);
gint g_sequence_get_length (GSequence *seq);
GSequencePtr g_sequence_get_end_ptr (GSequence *seq);
GSequencePtr g_sequence_get_begin_ptr (GSequence *seq);
GSequencePtr g_sequence_get_ptr_at_pos (GSequence *seq,
gint pos);
/* GSequencePtr */
gboolean g_sequence_ptr_is_end (GSequencePtr ptr);
gboolean g_sequence_ptr_is_begin (GSequencePtr ptr);
gint g_sequence_ptr_get_position (GSequencePtr ptr);
GSequencePtr g_sequence_ptr_next (GSequencePtr ptr);
GSequencePtr g_sequence_ptr_prev (GSequencePtr ptr);
GSequencePtr g_sequence_ptr_move (GSequencePtr ptr,
guint leap);
void g_sequence_ptr_sort_changed (GSequencePtr ptr,
GCompareDataFunc cmp_func,
gpointer cmp_data);
gpointer g_sequence_ptr_get_data (GSequencePtr ptr);
/* search */ /* Getting iters */
GSequenceIter *g_sequence_get_begin_iter (GSequence *seq);
GSequenceIter *g_sequence_get_end_iter (GSequence *seq);
GSequenceIter *g_sequence_get_iter_at_pos (GSequence *seq,
gint pos);
GSequenceIter *g_sequence_append (GSequence *seq,
gpointer data);
GSequenceIter *g_sequence_prepend (GSequence *seq,
gpointer data);
GSequenceIter *g_sequence_insert_before (GSequenceIter * iter,
gpointer data);
void g_sequence_move (GSequenceIter * src,
GSequenceIter * dest);
GSequenceIter *g_sequence_insert_sorted (GSequence *seq,
gpointer data,
GCompareDataFunc cmp_func,
gpointer cmp_data);
GSequenceIter *g_sequence_insert_sorted_iter (GSequence *seq,
gpointer data,
GSequenceIterCompareFunc iter_cmp,
gpointer cmp_data);
void g_sequence_sort_changed (GSequenceIter * iter,
GCompareDataFunc cmp_func,
gpointer cmp_data);
void g_sequence_sort_changed_iter (GSequenceIter * iter,
GSequenceIterCompareFunc iter_cmp,
gpointer cmp_data);
void g_sequence_remove (GSequenceIter * iter);
void g_sequence_remove_range (GSequenceIter * begin,
GSequenceIter * end);
void g_sequence_move_range (GSequenceIter * iter,
GSequenceIter * begin,
GSequenceIter * end);
GSequenceIter *g_sequence_search (GSequence *seq,
gpointer data,
GCompareDataFunc cmp_func,
gpointer cmp_data);
GSequenceIter *g_sequence_search_iter (GSequence *seq,
gpointer data,
GSequenceIterCompareFunc cmp_func,
gpointer cmp_data);
/* dereferencing */
gpointer g_sequence_get (GSequenceIter * iter);
void g_sequence_set (GSequenceIter * iter,
gpointer data);
/* return TRUE if you want to be called again with two
* smaller segments
*/
typedef gboolean (* GSequenceSearchFunc) (GSequencePtr begin,
GSequencePtr end,
gpointer data);
void g_sequence_search (GSequence *seq, /* operations on GSequenceIter * */
GSequenceSearchFunc f, gboolean g_sequence_iter_is_begin (GSequenceIter * iter);
gpointer data); gboolean g_sequence_iter_is_end (GSequenceIter * iter);
GSequenceIter *g_sequence_iter_next (GSequenceIter * iter);
GSequenceIter *g_sequence_iter_prev (GSequenceIter * iter);
gint g_sequence_iter_get_position (GSequenceIter * iter);
GSequenceIter *g_sequence_iter_move (GSequenceIter * iter,
gint leap);
GSequence * g_sequence_iter_get_sequence (GSequenceIter * iter);
void g_sequence_swap (GSequenceIter *a,
GSequenceIter *b);
/* search */
gint g_sequence_iter_compare (GSequenceIter *a,
GSequenceIter * b);
GSequenceIter *g_sequence_range_get_midpoint (GSequenceIter * begin,
GSequenceIter * end);
/* debug */ /* debug */
gint g_sequence_calc_tree_height (GSequence *seq); gint g_sequence_calc_tree_height (GSequence *seq);
void g_sequence_self_test (GSequence *seq);
#if 0
/* aggregates */
void g_sequence_set_aggregator (GSequence *seq,
GSequenceAggregateFunction func,
GDestroyNotify destroy);
gconstpointer g_sequence_get_aggregate (GSequenceIter * begin,
GSequenceIter * end);
void g_sequence_update_aggregate (GSequenceIter * iter);
#endif
#endif /* __GSEQUENCE_H__ */ #endif /* __GSEQUENCE_H__ */
...@@ -56,8 +56,8 @@ static GObjectClass *parent_class; ...@@ -56,8 +56,8 @@ static GObjectClass *parent_class;
struct FMListModelDetails { struct FMListModelDetails {
GSequence *files; GSequence *files;
GHashTable *directory_reverse_map; /* map from directory to GSequencePtr's */ GHashTable *directory_reverse_map; /* map from directory to GSequenceIter's */
GHashTable *top_reverse_map; /* map from files in top dir to GSequencePtr's */ GHashTable *top_reverse_map; /* map from files in top dir to GSequenceIter's */
int stamp; int stamp;
...@@ -83,11 +83,11 @@ typedef struct FileEntry FileEntry; ...@@ -83,11 +83,11 @@ typedef struct FileEntry FileEntry;
struct FileEntry { struct FileEntry {
NautilusFile *file; NautilusFile *file;
GHashTable *reverse_map; /* map from files to GSequencePtr's */ GHashTable *reverse_map; /* map from files to GSequenceIter's */
NautilusDirectory *subdirectory; NautilusDirectory *subdirectory;
FileEntry *parent; FileEntry *parent;
GSequence *files; GSequence *files;
GSequencePtr ptr; GSequenceIter *ptr;
guint loaded : 1; guint loaded : 1;
}; };
...@@ -163,9 +163,9 @@ fm_list_model_get_column_type (GtkTreeModel *tree_model, int index) ...@@ -163,9 +163,9 @@ fm_list_model_get_column_type (GtkTreeModel *tree_model, int index)
} }
static void static void
fm_list_model_ptr_to_iter (FMListModel *model, GSequencePtr ptr, GtkTreeIter *iter) fm_list_model_ptr_to_iter (FMListModel *model, GSequenceIter *ptr, GtkTreeIter *iter)
{ {
g_assert (!g_sequence_ptr_is_end (ptr)); g_assert (!g_sequence_iter_is_end (ptr));
if (iter != NULL) { if (iter != NULL) {
iter->stamp = model->details->stamp; iter->stamp = model->details->stamp;
iter->user_data = ptr; iter->user_data = ptr;
...@@ -177,7 +177,7 @@ fm_list_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath ...@@ -177,7 +177,7 @@ fm_list_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath
{ {
FMListModel *model; FMListModel *model;
GSequence *files; GSequence *files;
GSequencePtr ptr; GSequenceIter *ptr;
FileEntry *file_entry; FileEntry *file_entry;
int i, d; int i, d;
...@@ -192,8 +192,8 @@ fm_list_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath ...@@ -192,8 +192,8 @@ fm_list_model_get_iter (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreePath
return FALSE; return FALSE;
} }
ptr = g_sequence_get_ptr_at_pos (files, i); ptr = g_sequence_get_iter_at_pos (files, i);
file_entry = g_sequence_ptr_get_data (ptr); file_entry = g_sequence_get (ptr);
files = file_entry->files; files = file_entry->files;
} }
...@@ -207,7 +207,7 @@ fm_list_model_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter) ...@@ -207,7 +207,7 @@ fm_list_model_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter)
{ {
GtkTreePath *path; GtkTreePath *path;
FMListModel *model; FMListModel *model;
GSequencePtr ptr; GSequenceIter *ptr;
FileEntry *file_entry; FileEntry *file_entry;
...@@ -215,7 +215,7 @@ fm_list_model_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter) ...@@ -215,7 +215,7 @@ fm_list_model_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter)
g_return_val_if_fail (iter->stamp == model->details->stamp, NULL); g_return_val_if_fail (iter->stamp == model->details->stamp, NULL);
if (g_sequence_ptr_is_end (iter->user_data)) { if (g_sequence_iter_is_end (iter->user_data)) {
/* FIXME is this right? */ /* FIXME is this right? */
return NULL; return NULL;
} }
...@@ -223,8 +223,8 @@ fm_list_model_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter) ...@@ -223,8 +223,8 @@ fm_list_model_get_path (GtkTreeModel *tree_model, GtkTreeIter *iter)
path = gtk_tree_path_new (); path = gtk_tree_path_new ();
ptr = iter->user_data; ptr = iter->user_data;
while (ptr != NULL) { while (ptr != NULL) {
gtk_tree_path_prepend_index (path, g_sequence_ptr_get_position (ptr)); gtk_tree_path_prepend_index (path, g_sequence_iter_get_position (ptr));
file_entry = g_sequence_ptr_get_data (ptr); file_entry = g_sequence_get (ptr);
if (file_entry->parent != NULL) { if (file_entry->parent != NULL) {
ptr = file_entry->parent->ptr; ptr = file_entry->parent->ptr;
} else { } else {
...@@ -253,9 +253,9 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column ...@@ -253,9 +253,9 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column
model = (FMListModel *)tree_model; model = (FMListModel *)tree_model;
g_return_if_fail (model->details->stamp == iter->stamp); g_return_if_fail (model->details->stamp == iter->stamp);
g_return_if_fail (!g_sequence_ptr_is_end (iter->user_data)); g_return_if_fail (!g_sequence_iter_is_end (iter->user_data));
file_entry = g_sequence_ptr_get_data (iter->user_data); file_entry = g_sequence_get (iter->user_data);
file = file_entry->file; file = file_entry->file;
switch (column) { switch (column) {
...@@ -390,9 +390,9 @@ fm_list_model_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter) ...@@ -390,9 +390,9 @@ fm_list_model_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter)
g_return_val_if_fail (model->details->stamp == iter->stamp, FALSE); g_return_val_if_fail (model->details->stamp == iter->stamp, FALSE);
iter->user_data = g_sequence_ptr_next (iter->user_data); iter->user_data = g_sequence_iter_next (iter->user_data);
return !g_sequence_ptr_is_end (iter->user_data); return !g_sequence_iter_is_end (iter->user_data);
} }
static gboolean static gboolean
...@@ -407,7 +407,7 @@ fm_list_model_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTre ...@@ -407,7 +407,7 @@ fm_list_model_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTre
if (parent == NULL) { if (parent == NULL) {
files = model->details->files; files = model->details->files;
} else { } else {
file_entry = g_sequence_ptr_get_data (parent->user_data); file_entry = g_sequence_get (parent->user_data);
files = file_entry->files; files = file_entry->files;
} }
...@@ -416,7 +416,7 @@ fm_list_model_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTre ...@@ -416,7 +416,7 @@ fm_list_model_iter_children (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTre
} }
iter->stamp = model->details->stamp; iter->stamp = model->details->stamp;
iter->user_data = g_sequence_get_begin_ptr (files); iter->user_data = g_sequence_get_begin_iter (files);
return TRUE; return TRUE;
} }
...@@ -430,7 +430,7 @@ fm_list_model_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter) ...@@ -430,7 +430,7 @@ fm_list_model_iter_has_child (GtkTreeModel *tree_model, GtkTreeIter *iter)
return !fm_list_model_is_empty (FM_LIST_MODEL (tree_model)); return !fm_list_model_is_empty (FM_LIST_MODEL (tree_model));
} }
file_entry = g_sequence_ptr_get_data (iter->user_data); file_entry = g_sequence_get (iter->user_data);
return (file_entry->files != NULL && g_sequence_get_length (file_entry->files) > 0); return (file_entry->files != NULL && g_sequence_get_length (file_entry->files) > 0);
} }
...@@ -447,7 +447,7 @@ fm_list_model_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter) ...@@ -447,7 +447,7 @@ fm_list_model_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter)
if (iter == NULL) { if (iter == NULL) {
files = model->details->files; files = model->details->files;
} else { } else {
file_entry = g_sequence_ptr_get_data (iter->user_data); file_entry = g_sequence_get (iter->user_data);
files = file_entry->files; files = file_entry->files;
} }
...@@ -458,22 +458,22 @@ static gboolean ...@@ -458,22 +458,22 @@ static gboolean
fm_list_model_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent, int n) fm_list_model_iter_nth_child (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeIter *parent, int n)
{ {
FMListModel *model; FMListModel *model;
GSequencePtr child; GSequenceIter *child;
GSequence *files; GSequence *files;
FileEntry *file_entry; FileEntry *file_entry;
model = (FMListModel *)tree_model; model = (FMListModel *)tree_model;
if (parent != NULL) { if (parent != NULL) {
file_entry = g_sequence_ptr_get_data (parent->user_data); file_entry = g_sequence_get (parent->user_data);
files = file_entry->files; files = file_entry->files;
} else { } else {
files = model->details->files; files = model->details->files;
} }
child = g_sequence_get_ptr_at_pos (files, n); child = g_sequence_get_iter_at_pos (files, n);
if (g_sequence_ptr_is_end (child)) { if (g_sequence_iter_is_end (child)) {
return FALSE; return FALSE;
} }
...@@ -491,7 +491,7 @@ fm_list_model_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeI ...@@ -491,7 +491,7 @@ fm_list_model_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeI
model = (FMListModel *)tree_model; model = (FMListModel *)tree_model;
file_entry = g_sequence_ptr_get_data (child->user_data); file_entry = g_sequence_get (child->user_data);
if (file_entry->parent == NULL) { if (file_entry->parent == NULL) {
return FALSE; return FALSE;
...@@ -503,12 +503,12 @@ fm_list_model_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeI ...@@ -503,12 +503,12 @@ fm_list_model_iter_parent (GtkTreeModel *tree_model, GtkTreeIter *iter, GtkTreeI
return TRUE; return TRUE;
} }
static GSequencePtr static GSequenceIter *
lookup_file (FMListModel *model, NautilusFile *file, lookup_file (FMListModel *model, NautilusFile *file,
NautilusDirectory *directory) NautilusDirectory *directory)
{ {
FileEntry *file_entry; FileEntry *file_entry;
GSequencePtr ptr, parent_ptr; GSequenceIter *ptr, *parent_ptr;
parent_ptr = NULL; parent_ptr = NULL;
if (directory) { if (directory) {
...@@ -517,14 +517,14 @@ lookup_file (FMListModel *model, NautilusFile *file, ...@@ -517,14 +517,14 @@ lookup_file (FMListModel *model, NautilusFile *file,
} }
if (parent_ptr) { if (parent_ptr) {
file_entry = g_sequence_ptr_get_data (parent_ptr); file_entry = g_sequence_get (parent_ptr);
ptr = g_hash_table_lookup (file_entry->reverse_map, file); ptr = g_hash_table_lookup (file_entry->reverse_map, file);
} else { } else {
ptr = g_hash_table_lookup (model->details->top_reverse_map, file); ptr = g_hash_table_lookup (model->details->top_reverse_map, file);
} }
if (ptr) { if (ptr) {
g_assert (((FileEntry *)g_sequence_ptr_get_data (ptr))->file == file); g_assert (((FileEntry *)g_sequence_get (ptr))->file == file);
} }
return ptr; return ptr;
...@@ -541,7 +541,7 @@ static void ...@@ -541,7 +541,7 @@ static void
dir_to_iters (struct GetIters *data, dir_to_iters (struct GetIters *data,
GHashTable *reverse_map) GHashTable *reverse_map)
{ {
GSequencePtr ptr; GSequenceIter *ptr;
ptr = g_hash_table_lookup (reverse_map, data->file); ptr = g_hash_table_lookup (reverse_map, data->file);
if (ptr) { if (ptr) {
...@@ -561,7 +561,7 @@ file_to_iter_cb (gpointer key, ...@@ -561,7 +561,7 @@ file_to_iter_cb (gpointer key,
FileEntry *dir_file_entry; FileEntry *dir_file_entry;
data = user_data; data = user_data;
dir_file_entry = g_sequence_ptr_get_data ((GSequencePtr)value); dir_file_entry = g_sequence_get ((GSequenceIter *)value);
dir_to_iters (data, dir_file_entry->reverse_map); dir_to_iters (data, dir_file_entry->reverse_map);
} }
...@@ -607,7 +607,7 @@ fm_list_model_get_tree_iter_from_file (FMListModel *model, NautilusFile *file, ...@@ -607,7 +607,7 @@ fm_list_model_get_tree_iter_from_file (FMListModel *model, NautilusFile *file,
NautilusDirectory *directory, NautilusDirectory *directory,
GtkTreeIter *iter) GtkTreeIter *iter)
{ {
GSequencePtr ptr; GSequenceIter *ptr;
ptr = lookup_file (model, file, directory); ptr = lookup_file (model, file, directory);
if (!ptr) { if (!ptr) {
...@@ -666,7 +666,7 @@ fm_list_model_compare_func (FMListModel *model, ...@@ -666,7 +666,7 @@ fm_list_model_compare_func (FMListModel *model,
static void static void
fm_list_model_sort_file_entries (FMListModel *model, GSequence *files, GtkTreePath *path) fm_list_model_sort_file_entries (FMListModel *model, GSequence *files, GtkTreePath *path)
{ {
GSequencePtr *old_order; GSequenceIter **old_order;
GtkTreeIter iter; GtkTreeIter iter;
int *new_order; int *new_order;
int length; int length;
...@@ -680,12 +680,12 @@ fm_list_model_sort_file_entries (FMListModel *model, GSequence *files, GtkTreePa ...@@ -680,12 +680,12 @@ fm_list_model_sort_file_entries (FMListModel *model, GSequence *files, GtkTreePa
return; return;
} }
/* generate old order of GSequencePtr's */ /* generate old order of GSequenceIter's */
old_order = g_new (GSequencePtr, length); old_order = g_new (GSequenceIter *, length);
for (i = 0; i < length; ++i) { for (i = 0; i < length; ++i) {
GSequencePtr ptr = g_sequence_get_ptr_at_pos (files, i); GSequenceIter *ptr = g_sequence_get_iter_at_pos (files, i);
file_entry = g_sequence_ptr_get_data (ptr); file_entry = g_sequence_get (ptr);
if (file_entry->files != NULL) { if (file_entry->files != NULL) {
gtk_tree_path_append_index (path, i); gtk_tree_path_append_index (path, i);
fm_list_model_sort_file_entries (model, file_entry->files, path); fm_list_model_sort_file_entries (model, file_entry->files, path);
...@@ -702,7 +702,7 @@ fm_list_model_sort_file_entries (FMListModel *model, GSequence *files, GtkTreePa ...@@ -702,7 +702,7 @@ fm_list_model_sort_file_entries (FMListModel *model, GSequence *files, GtkTreePa
new_order = g_new (int, length); new_order = g_new (int, length);
/* Note: new_order[newpos] = oldpos */ /* Note: new_order[newpos] = oldpos */
for (i = 0; i < length; ++i) { for (i = 0; i < length; ++i) {
new_order[g_sequence_ptr_get_position (old_order[i])] = i; new_order[g_sequence_iter_get_position (old_order[i])] = i;
} }
/* Let the world know about our new order */ /* Let the world know about our new order */
...@@ -910,7 +910,7 @@ fm_list_model_add_file (FMListModel *model, NautilusFile *file, ...@@ -910,7 +910,7 @@ fm_list_model_add_file (FMListModel *model, NautilusFile *file,
GtkTreeIter iter; GtkTreeIter iter;
GtkTreePath *path; GtkTreePath *path;
FileEntry *file_entry; FileEntry *file_entry;
GSequencePtr ptr, parent_ptr; GSequenceIter *ptr, *parent_ptr;
GSequence *files; GSequence *files;
gboolean replace_dummy; gboolean replace_dummy;
GHashTable *parent_hash; GHashTable *parent_hash;
...@@ -918,7 +918,7 @@ fm_list_model_add_file (FMListModel *model, NautilusFile *file, ...@@ -918,7 +918,7 @@ fm_list_model_add_file (FMListModel *model, NautilusFile *file,
parent_ptr = g_hash_table_lookup (model->details->directory_reverse_map, parent_ptr = g_hash_table_lookup (model->details->directory_reverse_map,
directory); directory);
if (parent_ptr) { if (parent_ptr) {
file_entry = g_sequence_ptr_get_data (parent_ptr); file_entry = g_sequence_get (parent_ptr);
ptr = g_hash_table_lookup (file_entry->reverse_map, file); ptr = g_hash_table_lookup (file_entry->reverse_map, file);
} else { } else {
file_entry = NULL; file_entry = NULL;
...@@ -942,12 +942,12 @@ fm_list_model_add_file (FMListModel *model, NautilusFile *file, ...@@ -942,12 +942,12 @@ fm_list_model_add_file (FMListModel *model, NautilusFile *file,
replace_dummy = FALSE; replace_dummy = FALSE;
if (parent_ptr != NULL) { if (parent_ptr != NULL) {
file_entry->parent = g_sequence_ptr_get_data (parent_ptr); file_entry->parent = g_sequence_get (parent_ptr);
parent_hash = file_entry->parent->reverse_map; parent_hash = file_entry->parent->reverse_map;
files = file_entry->parent->files; files = file_entry->parent->files;
if (g_sequence_get_length (files) == 1) { if (g_sequence_get_length (files) == 1) {
GSequencePtr dummy_ptr = g_sequence_get_ptr_at_pos (files, 0); GSequenceIter *dummy_ptr = g_sequence_get_iter_at_pos (files, 0);
FileEntry *dummy_entry = g_sequence_ptr_get_data (dummy_ptr); FileEntry *dummy_entry = g_sequence_get (dummy_ptr);
if (dummy_entry->file == NULL) { if (dummy_entry->file == NULL) {
/* replace the dummy loading entry */ /* replace the dummy loading entry */
model->details->stamp++; model->details->stamp++;
...@@ -994,7 +994,7 @@ fm_list_model_file_changed (FMListModel *model, NautilusFile *file, ...@@ -994,7 +994,7 @@ fm_list_model_file_changed (FMListModel *model, NautilusFile *file,
FileEntry *parent_file_entry; FileEntry *parent_file_entry;
GtkTreeIter iter; GtkTreeIter iter;
GtkTreePath *path, *parent_path; GtkTreePath *path, *parent_path;
GSequencePtr ptr; GSequenceIter *ptr;
int pos_before, pos_after, length, i, old; int pos_before, pos_after, length, i, old;
int *new_order; int *new_order;
gboolean has_iter; gboolean has_iter;
...@@ -1006,16 +1006,16 @@ fm_list_model_file_changed (FMListModel *model, NautilusFile *file, ...@@ -1006,16 +1006,16 @@ fm_list_model_file_changed (FMListModel *model, NautilusFile *file,
} }
pos_before = g_sequence_ptr_get_position (ptr); pos_before = g_sequence_iter_get_position (ptr);
g_sequence_ptr_sort_changed (ptr, fm_list_model_file_entry_compare_func, model); g_sequence_sort_changed (ptr, fm_list_model_file_entry_compare_func, model);
pos_after = g_sequence_ptr_get_position (ptr); pos_after = g_sequence_iter_get_position (ptr);
if (pos_before != pos_after) { if (pos_before != pos_after) {
/* The file moved, we need to send rows_reordered */ /* The file moved, we need to send rows_reordered */
parent_file_entry = ((FileEntry *)g_sequence_ptr_get_data (ptr))->parent; parent_file_entry = ((FileEntry *)g_sequence_get (ptr))->parent;
if (parent_file_entry == NULL) { if (parent_file_entry == NULL) {
has_iter = FALSE; has_iter = FALSE;
...@@ -1069,18 +1069,18 @@ fm_list_model_get_length (FMListModel *model) ...@@ -1069,18 +1069,18 @@ fm_list_model_get_length (FMListModel *model)
static void static void
fm_list_model_remove (FMListModel *model, GtkTreeIter *iter) fm_list_model_remove (FMListModel *model, GtkTreeIter *iter)
{ {
GSequencePtr ptr, child_ptr; GSequenceIter *ptr, *child_ptr;
FileEntry *file_entry, *child_file_entry, *parent_file_entry; FileEntry *file_entry, *child_file_entry, *parent_file_entry;
GtkTreePath *path; GtkTreePath *path;
GtkTreeIter parent_iter; GtkTreeIter parent_iter;
ptr = iter->user_data; ptr = iter->user_data;
file_entry = g_sequence_ptr_get_data (ptr); file_entry = g_sequence_get (ptr);
if (file_entry->files != NULL) { if (file_entry->files != NULL) {
while (g_sequence_get_length (file_entry->files) > 0) { while (g_sequence_get_length (file_entry->files) > 0) {
child_ptr = g_sequence_get_begin_ptr (file_entry->files); child_ptr = g_sequence_get_begin_iter (file_entry->files);
child_file_entry = g_sequence_ptr_get_data (child_ptr); child_file_entry = g_sequence_get (child_ptr);
if (child_file_entry->file != NULL) { if (child_file_entry->file != NULL) {
fm_list_model_remove_file (model, fm_list_model_remove_file (model,
child_file_entry->file, child_file_entry->file,
...@@ -1162,9 +1162,9 @@ fm_list_model_clear_directory (FMListModel *model, GSequence *files) ...@@ -1162,9 +1162,9 @@ fm_list_model_clear_directory (FMListModel *model, GSequence *files)
FileEntry *file_entry; FileEntry *file_entry;
while (g_sequence_get_length (files) > 0) { while (g_sequence_get_length (files) > 0) {
iter.user_data = g_sequence_get_begin_ptr (files); iter.user_data = g_sequence_get_begin_iter (files);