- removed_files = 0;
- renamed_files = 0;
- for (f = add_files_state.removed_files->head; f; f = f->next) {
- status = notmuch_database_remove_message (notmuch, f->filename);
- if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID)
- renamed_files++;
- else
- removed_files++;
+ gettimeofday (&tv_start, NULL);
+ for (f = add_files_state.removed_files->head; f && !interrupted; f = f->next) {
+ ret = remove_filename (notmuch, f->filename, &add_files_state);
+ if (ret)
+ goto DONE;
+ if (do_print_progress) {
+ do_print_progress = 0;
+ generic_print_progress ("Cleaned up", "messages",
+ tv_start, add_files_state.removed_messages + add_files_state.renamed_messages,
+ add_files_state.removed_files->count);
+ }
+ }
+
+ gettimeofday (&tv_start, NULL);
+ for (f = add_files_state.removed_directories->head, i = 0; f && !interrupted; f = f->next, i++) {
+ ret = _remove_directory (config, notmuch, f->filename, &add_files_state);
+ if (ret)
+ goto DONE;
+ if (do_print_progress) {
+ do_print_progress = 0;
+ generic_print_progress ("Cleaned up", "directories",
+ tv_start, i,
+ add_files_state.removed_directories->count);
+ }