Changeset 8596


Ignore:
Timestamp:
2004-11-18T12:06:13+13:00 (19 years ago)
Author:
mdewsnip
Message:

Minor tidy ups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java

    r8595 r8596  
    445445            // If we haven't been cancelled, and we've been asked to delete a directory/file, or perhaps as part of a move, we delete the file. This involves removing any existing metadata and then copying the file to the recycled bin (for a delete only), then deleting the file. When deleting a directory record from the tree (or from the filesystem for that matter) we must ensure that all of the descendant records have already been removed. If we fail to do this the delete will fail, or you will be bombarded with hundreds of 'Parent node of null not allowed' error messages. Also be aware that if the user has cancelled just this action, because of say a name clash, then we shouldn't do any deleting of any sort dammit.
    446446            if(!cancel_action && ready && (job.type == FileJob.DELETE || job.type == FileJob.MOVE)) {
    447             ///atherer.println("Delete/Move: " + origin_node);
    448             ///atherer.println(queue.size() + " jobs remain in queue");
    449 
     447            // Update the progress bar for this job
    450448            if (source_file.isFile()) {
    451449                progress.addValue(source_file.length());
     
    455453            File[] child_list = source_file.listFiles();
    456454            if (source_file.isFile() || (child_list != null && child_list.length == 0 && origin_node.getParent() != null)) {
    457                 // System.err.println("Deleting file: " + source_file.getAbsolutePath());
    458 
    459455                // Update status area
    460456                String args[] = new String[1];
     
    485481            // Else the source is a directory and it has children remaining
    486482            else if(child_list != null && child_list.length > 0) {
    487                 FileNode recycle_folder_record = null;
    488483                // Don't worry about all this for true file move actions.
    489484                if(job.type == FileJob.DELETE) {
     
    512507            target_file = null;
    513508            origin_node = null;
    514             // We can only break out of the while loop if we are out of files, or if the action was cancelled.
    515             if(cancel_action) {
     509
     510            // We only break out of the while loop if we are out of files or the action was cancelled
     511            if (cancel_action) {
    516512            // Empty queue
    517513            clearJobs();
    518514            cancel_action = false;
    519515            }
    520             // Debugging pause.
    521             ///ystem.err.println("Job complete.");
    522516        }
    523517        else {
    524518            // Disable stop button
    525             if(stop_button != null) {
     519            if (stop_button != null) {
    526520            stop_button.setEnabled(false);
    527521            }
     
    547541    }
    548542    }
    549    
     543
     544
    550545    /** Register the button that will be responsible for stopping executing file actions.
    551546     * @param stop_button a JButton
Note: See TracChangeset for help on using the changeset viewer.