Changeset 7516


Ignore:
Timestamp:
2004-06-01T11:27:13+12:00 (20 years ago)
Author:
kjdon
Message:

on windows dont use the registry to get commands, just use teh start command

File:
1 edited

Legend:

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

    r7092 r7516  
    5858        for(int i = 0; i < entries.getLength(); i++) {
    5959        Element entry = (Element) entries.item(i);
    60         String extension = entry.getAttribute(StaticStrings.EXTENSION_ATTRIBUTE);
    6160        String command = MSMUtils.getValue(entry);
    6261        // If we encounter a command of ""...
    6362        if(command.length() == 0) {
    64             // and if we are on windows, we try to automatically set this command.
     63            // if we are on windows, we default to the start command
    6564            if(Utility.isWindows()) {
    66             // Create a dummy filename with the appropriate extension
    67             String dummy_file = "dummy." + extension;
    68             command = WinRegistry.openCommand(dummy_file);
    69             // If this succeeded add the association.
    70             if(command != null) {
    71                 // Remember to replace the dummy filename with %1
    72                 command = command.replaceAll(dummy_file, FILENAME_ARG);
    73                 // Replace the text in this node.
    74                 MSMUtils.setValue(entry, command);
     65            if (Utility.isWindows9x()) {
     66                MSMUtils.setValue(entry, StaticStrings.WIN_9X_OPEN_COMMAND);
     67            } else {
     68                MSMUtils.setValue(entry, StaticStrings.WIN_OPEN_COMMAND);
    7569            }
    76             dummy_file = null;
    7770            }
    78             // and if we are on windows, we default to the open program
    79             if(Utility.isMac()) {
     71            // and if we are on mac, we default to the open program
     72            else if(Utility.isMac()) {
    8073            MSMUtils.setValue(entry, StaticStrings.MAC_OPEN_COMMAND);
    8174            }
    8275        }
    8376        command = null;
    84         extension = null;
    8577        entry = null;
    8678        }
     
    184176        // If command is null, and we are on windows try searching the registry.
    185177        if(Utility.isWindows()) {
    186             ///ystem.err.println("Is Windows");
    187             //command = WinRegistry.openCommand(filename);
    188178            //try the start command
    189179            if (Utility.isWindows9x()) {
     
    197187        // If we are on a mac, default to using the open program
    198188        else if(Utility.isMac()) {
    199             ///ystem.err.println("Is Mac");
    200189            command = StaticStrings.MAC_OPEN_COMMAND;
    201190        }
Note: See TracChangeset for help on using the changeset viewer.