comparison src/cache_maint.c @ 442:4b2d7f9af171

Big whitespaces cleanup: - drop whitespaces at end of lines - convert eight spaces to tab at start of lines - drop spurious spaces mixed with tabs - remove empty lines at end of files
author zas_
date Sun, 20 Apr 2008 13:04:57 +0000
parents 767b53cd9ab7
children ddabc4873a3f
comparison
equal deleted inserted replaced
441:08eb7137cd94 442:4b2d7f9af171
172 { 172 {
173 GList *work; 173 GList *work;
174 174
175 just_done = TRUE; 175 just_done = TRUE;
176 still_have_a_file = FALSE; 176 still_have_a_file = FALSE;
177 177
178 work = list; 178 work = list;
179 while (work) 179 while (work)
180 { 180 {
181 gchar *path_buf = work->data; 181 gchar *path_buf = work->data;
182 gchar *dot; 182 gchar *dot;
183 183
184 dot = extension_find_dot(path_buf); 184 dot = extension_find_dot(path_buf);
185 185
186 if (dot) *dot = '\0'; 186 if (dot) *dot = '\0';
187 if ((!cm->metadata && cm->clear) || 187 if ((!cm->metadata && cm->clear) ||
188 (strlen(path_buf) > base_length && !isfile(path_buf + base_length)) ) 188 (strlen(path_buf) > base_length && !isfile(path_buf + base_length)) )
189 { 189 {
190 if (dot) *dot = '.'; 190 if (dot) *dot = '.';
203 cm->list = g_list_concat(dlist, cm->list); 203 cm->list = g_list_concat(dlist, cm->list);
204 204
205 if (cm->list && g_list_find(cm->done_list, cm->list->data) != NULL) 205 if (cm->list && g_list_find(cm->done_list, cm->list->data) != NULL)
206 { 206 {
207 /* check if the dir is empty */ 207 /* check if the dir is empty */
208 208
209 if (cm->list->data == path && just_done) 209 if (cm->list->data == path && just_done)
210 { 210 {
211 if (!still_have_a_file && !dlist && cm->list->next && !rmdir_utf8(path)) 211 if (!still_have_a_file && !dlist && cm->list->next && !rmdir_utf8(path))
212 { 212 {
213 printf("Unable to delete dir: %s\n", path); 213 printf("Unable to delete dir: %s\n", path);
336 gtk_widget_show(cm->entry); 336 gtk_widget_show(cm->entry);
337 337
338 cm->spinner = spinner_new(NULL, SPINNER_SPEED); 338 cm->spinner = spinner_new(NULL, SPINNER_SPEED);
339 gtk_box_pack_start(GTK_BOX(hbox), cm->spinner, FALSE, FALSE, 0); 339 gtk_box_pack_start(GTK_BOX(hbox), cm->spinner, FALSE, FALSE, 0);
340 gtk_widget_show(cm->spinner); 340 gtk_widget_show(cm->spinner);
341 341
342 gtk_widget_show(cm->gd->dialog); 342 gtk_widget_show(cm->gd->dialog);
343 343
344 cm->idle_id = g_idle_add(cache_maintain_home_cb, cm); 344 cm->idle_id = g_idle_add(cache_maintain_home_cb, cm);
345 } 345 }
346 346
536 base = cache_get_location(CACHE_TYPE_METADATA, dest, FALSE, &mode); 536 base = cache_get_location(CACHE_TYPE_METADATA, dest, FALSE, &mode);
537 if (cache_ensure_dir_exists(base, mode)) 537 if (cache_ensure_dir_exists(base, mode))
538 { 538 {
539 gchar *buf; 539 gchar *buf;
540 gchar *d; 540 gchar *d;
541 541
542 buf = cache_find_location(CACHE_TYPE_METADATA, src); 542 buf = cache_find_location(CACHE_TYPE_METADATA, src);
543 d = cache_get_location(CACHE_TYPE_METADATA, dest, TRUE, NULL); 543 d = cache_get_location(CACHE_TYPE_METADATA, dest, TRUE, NULL);
544 cache_file_move(buf, d); 544 cache_file_move(buf, d);
545 g_free(d); 545 g_free(d);
546 g_free(buf); 546 g_free(buf);
590 590
591 dest_base = cache_get_location(CACHE_TYPE_METADATA, fd->change->dest, FALSE, &mode); 591 dest_base = cache_get_location(CACHE_TYPE_METADATA, fd->change->dest, FALSE, &mode);
592 if (cache_ensure_dir_exists(dest_base, mode)) 592 if (cache_ensure_dir_exists(dest_base, mode))
593 { 593 {
594 gchar *path; 594 gchar *path;
595 595
596 path = cache_get_location(CACHE_TYPE_METADATA, fd->change->dest, TRUE, NULL); 596 path = cache_get_location(CACHE_TYPE_METADATA, fd->change->dest, TRUE, NULL);
597 if (!copy_file(src_cache, path)) 597 if (!copy_file(src_cache, path))
598 { 598 {
599 if (debug) printf("failed to copy metadata %s to %s\n", src_cache, path); 599 if (debug) printf("failed to copy metadata %s to %s\n", src_cache, path);
600 } 600 }
791 parse_out_relatives(path); 791 parse_out_relatives(path);
792 792
793 if (!isdir(path)) 793 if (!isdir(path))
794 { 794 {
795 warning_dialog(_("Invalid folder"), 795 warning_dialog(_("Invalid folder"),
796 _("The specified folder can not be found."), 796 _("The specified folder can not be found."),
797 GTK_STOCK_DIALOG_WARNING, cd->gd->dialog); 797 GTK_STOCK_DIALOG_WARNING, cd->gd->dialog);
798 } 798 }
799 else 799 else
800 { 800 {
801 gtk_widget_set_sensitive(cd->group, FALSE); 801 gtk_widget_set_sensitive(cd->group, FALSE);
972 { 972 {
973 gchar *next_path; 973 gchar *next_path;
974 974
975 next_path = cd->list->data; 975 next_path = cd->list->data;
976 cd->list = g_list_remove(cd->list, next_path); 976 cd->list = g_list_remove(cd->list, next_path);
977 977
978 cd->tl = thumb_loader_std_thumb_file_validate(next_path, cd->days, 978 cd->tl = thumb_loader_std_thumb_file_validate(next_path, cd->days,
979 cache_manager_standard_clean_valid_cb, cd); 979 cache_manager_standard_clean_valid_cb, cd);
980 g_free(next_path); 980 g_free(next_path);
981 } 981 }
982 else 982 else