~ubuntu-branches/ubuntu/hardy/gthumb/hardy-proposed

« back to all changes in this revision

Viewing changes to src/dlg-search.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2008-05-29 14:58:39 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20080529145839-cvei0exm56janrxs
Tags: 3:2.10.8-0ubuntu1
* New upstream bugfix release:
  - If the directory doesn't exists go to the closest existing parent.
    Fixes bug #495575 – infinite loop when browsing deleted dirs
  - Fixed bug #Bug 498741 – gthumb always saves thumbnails despite the
    gconf option in apps -> gthumb -> browser -> save_thumbnails set
    to "false"
  - Fixed bug #500719 – segfault when canceling batch operations
  - Fixed bug #486886: Crash opening an image with no Exif IFD1
  - Fixed bug #487982: can freeze gthumb during printing
  - Fixed a printing crash, g_free -> gtk_paper_size_free
  - Fixed bug #492111: Doesn't rotate pictures while importing
  - Fixed bug #492262: Rotate removes thumbnail
  - Fixed bug #492260: Crash on rotate on x86_64
  - Fixed bug #492169: Crash when moving directory to trash
  - Fixed bug #492370: monitor name conflict with libc on solaris10
  - Fixed exif tag read/write functions, so they can access 32-bit
    values correctly on 64-bit platforms
  - Fixed bug #476989: gthumb doesn't move images if destination
    directory is selected from folder drop down list
  - Fixed bug #495529: Search not working
  - Fixed bug #498995: gthumb gets it's locking wrong and crashes
  - When sorting by exif time, fall back to sorting by mtime if no
    exif time is present.
  - Fixed bug #438027: cancel isn't honoured in "reset exif orientation"
    progress dialog or rotation-tool dialog
  - Fixed bug #499795: silently fails to save bmp picture
  - Fixed bug #496140: Crop Window opens too large for dual-screens
  - Fixed bug #481729: Crash browsing thru images when one is empty.
  - Fixed bug #482751: gthumb crashes if it cannot find cursor.
  - Fixed bug #485721: Crash in fullscreen mode after deleting an image.
  - Fixed bug #471234: Fix build with gcc 2.x
  - Fixed bug #485998: '[' and ']' don't work in fullscreen anymore.
  - Fixed LP: #152246: gThumb does not allow to change
    picture's "Last modified date" to "Photo digitalization date
    (from EXIF data)"
* Drop 21_dont_skip_file_type.dpatch and 22_paper_size_free.dpatch: Included
  upstream.
* 90_autoconf.dpatch: Update for new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
 
142
142
        GHashTable     *folders_comment;
143
143
        GHashTable     *hidden_files;
 
144
        GHashTable     *visited_dirs;
144
145
} DialogData;
145
146
 
146
147
 
185
186
                file_data_list_free (data->files);
186
187
                data->files = NULL;
187
188
        }
188
 
 
 
189
        
189
190
        if (data->dirs) {
190
191
                path_list_free (data->dirs);
191
192
                data->dirs = NULL;
192
193
        }
193
 
 
 
194
        
194
195
        g_hash_table_foreach_remove (data->folders_comment, remove_folder_comment_cb, NULL);
 
196
        
 
197
        if (data->visited_dirs != NULL) {
 
198
                g_hash_table_destroy (data->visited_dirs);
 
199
                data->visited_dirs = NULL;
 
200
        }
195
201
}
196
202
 
197
203
 
320
326
destroy_progress_cb (GtkWidget *widget,
321
327
                     DialogData *data)
322
328
{
 
329
        gth_file_list_stop (data->file_list);
323
330
        cancel_progress_dlg_cb (widget, data);
324
331
        gtk_widget_destroy (data->dialog);
325
332
}
448
455
cancel_progress_dlg_cb (GtkWidget  *widget,
449
456
                        DialogData *data)
450
457
{
451
 
        gth_file_list_stop (data->file_list);
452
458
        if (data->handle == NULL)
453
459
                return;
454
460
        gnome_vfs_async_cancel (data->handle);
550
556
        data->catalog_path = catalog_path;
551
557
        data->folders_comment = g_hash_table_new (g_str_hash, g_str_equal);
552
558
        data->hidden_files = NULL;
 
559
        data->visited_dirs = NULL;
553
560
 
554
561
        /* Get the widgets. */
555
562
 
1003
1010
        for (node = list; node != NULL; node = node->next) {
1004
1011
                GnomeVFSURI *full_uri = NULL;
1005
1012
                char        *str_uri;
1006
 
                char        *unesc_uri;
 
1013
                char        *real_uri;
 
1014
                char        *unesc_uri;  
1007
1015
 
1008
1016
                info = node->data;
1009
1017
 
1029
1037
                        if (g_hash_table_lookup (data->hidden_files, info->name) != NULL)
1030
1038
                                break;
1031
1039
                        full_uri = gnome_vfs_uri_append_path (data->uri, info->name);
1032
 
                        data->dirs = g_list_prepend (data->dirs, gnome_vfs_uri_to_string (full_uri, GNOME_VFS_URI_HIDE_NONE));
 
1040
                        str_uri = gnome_vfs_uri_to_string (full_uri, GNOME_VFS_URI_HIDE_NONE);
 
1041
                        if (resolve_all_symlinks (str_uri, &real_uri) == GNOME_VFS_OK) {
 
1042
                                if (g_hash_table_lookup (data->visited_dirs, real_uri) == NULL) { 
 
1043
                                        data->dirs = g_list_prepend (data->dirs, g_strdup (real_uri));
 
1044
                                        g_hash_table_insert (data->visited_dirs, g_strdup (real_uri), GINT_TO_POINTER (1));
 
1045
                                }
 
1046
                                g_free (real_uri);
 
1047
                        }
 
1048
                        g_free (str_uri);
1033
1049
                        break;
1034
1050
 
1035
1051
                default:
1043
1059
        if (files != NULL)
1044
1060
                add_file_list (data, files);
1045
1061
 
1046
 
        if (result == GNOME_VFS_ERROR_EOF) {
 
1062
        if (result != GNOME_VFS_OK) {
1047
1063
                gboolean good_dir_to_search_into = TRUE;
1048
1064
 
 
1065
                if (result != GNOME_VFS_ERROR_EOF) {
 
1066
                        char *path;
 
1067
 
 
1068
                        path = gnome_vfs_uri_to_string (data->uri,
 
1069
                                                        GNOME_VFS_URI_HIDE_NONE);
 
1070
                        /*g_warning ("Cannot load directory \"%s\": %s\n", path,
 
1071
                                   gnome_vfs_result_to_string (result));*/
 
1072
                        g_free (path);
 
1073
                }
 
1074
 
1049
1075
                if (! data->search_data->recursive) {
1050
1076
                        search_finished (data);
1051
1077
                        return;
1071
1097
                        g_free (dir);
1072
1098
                } while (! good_dir_to_search_into);
1073
1099
        } 
1074
 
        else if (result != GNOME_VFS_OK) {
1075
 
                char *path;
1076
 
 
1077
 
                path = gnome_vfs_uri_to_string (data->uri,
1078
 
                                                GNOME_VFS_URI_HIDE_NONE);
1079
 
                g_warning ("Cannot load directory \"%s\": %s\n", path,
1080
 
                           gnome_vfs_result_to_string (result));
1081
 
                g_free (path);
1082
 
 
1083
 
                search_finished (data);
1084
 
        }
1085
1100
}
1086
1101
 
1087
1102
 
1089
1104
search_dir_async (DialogData *data,
1090
1105
                  char       *dir)
1091
1106
{
 
1107
        char *uri, *real_uri;
 
1108
        
1092
1109
        _gtk_entry_set_filename_text (GTK_ENTRY (data->p_current_dir_entry), dir);
1093
1110
 
1094
1111
        /**/
1095
1112
 
1096
1113
        if (data->uri != NULL)
1097
1114
                gnome_vfs_uri_unref (data->uri);
1098
 
        data->uri = new_uri_from_path (dir);
 
1115
        
 
1116
        uri = add_scheme_if_absent (dir);
 
1117
        if (! resolve_all_symlinks (uri, &real_uri) == GNOME_VFS_OK) {
 
1118
                g_free (uri);
 
1119
                return;
 
1120
        }
 
1121
        g_free (uri);
 
1122
                 
 
1123
        g_hash_table_insert (data->visited_dirs, g_strdup (real_uri), GINT_TO_POINTER (1));
 
1124
        data->uri = new_uri_from_path (real_uri);
 
1125
        g_free (real_uri);
1099
1126
 
1100
1127
        if (data->hidden_files != NULL)
1101
1128
                g_hash_table_destroy (data->hidden_files);
1102
1129
        data->hidden_files = read_dot_hidden_file (dir);
1103
 
 
 
1130
                                      
1104
1131
        gnome_vfs_async_load_directory_uri (
1105
1132
                & (data->handle),
1106
1133
                data->uri,
1127
1154
        SearchData *search_data = data->search_data;
1128
1155
 
1129
1156
        free_search_results_data (data);
 
1157
        data->visited_dirs = g_hash_table_new_full (g_str_hash,
 
1158
                                                    g_str_equal,
 
1159
                                                    (GDestroyNotify) g_free,
 
1160
                                                    NULL);
1130
1161
        gth_file_list_set_list (data->file_list, NULL, pref_get_arrange_type (), pref_get_sort_order ());
1131
 
 
1132
1162
        search_dir_async (data, search_data->start_from);
1133
1163
}
1134
1164