use some of the new functions in filedata.c
authorVladimir Nadvornik <nadvornik@suse.cz>
Tue, 6 May 2008 20:24:16 +0000 (20:24 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Tue, 6 May 2008 20:24:16 +0000 (20:24 +0000)
src/filedata.c
src/filedata.h
src/utilops.c
src/view_file_list.c

index 0f0efd3..8de267c 100644 (file)
@@ -440,19 +440,6 @@ gint file_data_compare_name_without_ext(FileData *fd1, FileData *fd2)
        return strncmp(fd1->name, fd2->name, len1);
 }
 
-void file_data_do_change(FileData *fd)
-{
-//FIXME sidecars
-       g_assert(fd->change);
-       g_free(fd->path);
-       g_hash_table_remove(file_data_pool, fd->original_path);
-       g_free(fd->original_path);
-       file_data_set_path(fd, fd->change->dest);
-       fd->original_path = g_strdup(fd->change->dest);
-       g_hash_table_insert(file_data_pool, fd->original_path, fd);
-
-}
-
 gboolean file_data_add_change_info(FileData *fd, FileDataChangeType type, const gchar *src, const gchar *dest)
 {
 
@@ -523,23 +510,6 @@ static gint sidecar_file_priority(const gchar *path)
        return 0;
 }
 
-gchar *sidecar_file_data_list_to_string(FileData *fd)
-{
-       GList *work;
-       GString *result = g_string_new("");
-
-       work = fd->sidecar_files;
-       while (work)
-               {
-               FileData *sfd = work->data;
-               result = g_string_append(result, "+ ");
-               result = g_string_append(result, sfd->extension);
-               work = work->next;
-               if (work) result = g_string_append_c(result, ' ');
-               }
-
-       return g_string_free(result, FALSE);
-}
 
 /*
  *-----------------------------------------------------------------------------
@@ -897,7 +867,23 @@ GList *filelist_recursive(const gchar *path)
 
 
 /* return list of sidecar file extensions in a string */
-gchar *file_data_sc_list_to_string(FileData *fd); // now gchar *sidecar_file_data_list_to_string(FileData *fd)
+gchar *file_data_sc_list_to_string(FileData *fd)
+{
+       GList *work;
+       GString *result = g_string_new("");
+
+       work = fd->sidecar_files;
+       while (work)
+               {
+               FileData *sfd = work->data;
+               result = g_string_append(result, "+ ");
+               result = g_string_append(result, sfd->extension);
+               work = work->next;
+               if (work) result = g_string_append_c(result, ' ');
+               }
+
+       return g_string_free(result, FALSE);
+}
 
 
 /* disables / enables grouping for particular file, sends UPDATE notification */
@@ -1173,7 +1159,7 @@ static gboolean file_data_perform_ci(FileData *fd)
                case FILEDATA_CHANGE_DELETE:
                        return file_data_perform_delete(fd);
                case FILEDATA_CHANGE_UPDATE:
-                       /* notring to do here */
+                       /* nothing to do here */
                        break;
                }
        return TRUE;
@@ -1218,7 +1204,7 @@ static void file_data_apply_ci(FileData *fd)
                }
 }
 
-gint file_data_sc_apply_ci(FileData *fd) // now file_data_do_change
+gint file_data_sc_apply_ci(FileData *fd)
 {
        GList *work;
        FileDataChangeType type = fd->change->type;
index 32fc2fa..af3733b 100644 (file)
@@ -24,12 +24,9 @@ FileData *file_data_new_simple(const gchar *path_utf8);
 FileData *file_data_ref(FileData *fd);
 void file_data_unref(FileData *fd);
 
-void file_data_do_change(FileData *fd);
 gboolean file_data_add_change_info(FileData *fd, FileDataChangeType type, const gchar *src, const gchar *dest);
 void file_data_change_info_free(FileDataChangeInfo *fdci, FileData *fd);
 
-gchar *sidecar_file_data_list_to_string(FileData *fd);
-
 gint filelist_sort_compare_filedata(FileData *fa, FileData *fb);
 gint filelist_sort_compare_filedata_full(FileData *fa, FileData *fb, SortType method, gint ascend);
 GList *filelist_sort(GList *list, SortType method, gint ascend);
index f3815f2..6743429 100644 (file)
@@ -396,7 +396,7 @@ static gint move_file_ext_cb(gpointer ed, gint flags, GList *list, gpointer data
                FileData *fd = list->data;
                if (!(flags & EDITOR_ERROR_MASK))
                        {
-                       file_data_do_change(fd);
+                       file_data_sc_apply_ci(fd);
                        file_maint_moved(fd, NULL);
                        }
                file_data_change_info_free(NULL, fd);
@@ -421,7 +421,7 @@ gint move_file_ext(FileData *fd)
 
        if (ok)
                {
-               file_data_do_change(fd);
+               file_data_sc_apply_ci(fd);
                file_maint_moved(fd, NULL);
                }
 
@@ -445,7 +445,7 @@ static gint rename_file_ext_cb(gpointer ed, gint flags, GList *list, gpointer da
                FileData *fd = list->data;
                if (!(flags & EDITOR_ERROR_MASK))
                        {
-                       file_data_do_change(fd);
+                       file_data_sc_apply_ci(fd);
                        file_maint_renamed(fd);
                        }
                file_data_change_info_free(NULL, fd);
@@ -468,7 +468,7 @@ gint rename_file_ext(FileData *fd)
 
        if (ok)
                {
-               file_data_do_change(fd);
+               file_data_sc_apply_ci(fd);
                file_maint_renamed(fd);
                }
 
index 3719d3d..a68d84a 100644 (file)
@@ -962,7 +962,7 @@ static void vflist_setup_iter(ViewFile *vf, GtkTreeStore *store, GtkTreeIter *it
        gchar *sidecars = NULL;
 
        if (fd->sidecar_files)
-               sidecars = sidecar_file_data_list_to_string(fd);
+               sidecars = file_data_sc_list_to_string(fd);
        size = text_from_size(fd->size);
 
        gtk_tree_store_set(store, iter, FILE_COLUMN_POINTER, fd,