JAL-629 Doing things with the command line arguments
[jalview.git] / src / jalview / gui / Desktop.java
index 16603df..f2af0c0 100644 (file)
@@ -107,7 +107,6 @@ import jalview.io.DataSourceType;
 import jalview.io.FileFormat;
 import jalview.io.FileFormatException;
 import jalview.io.FileFormatI;
-import jalview.io.FileFormats;
 import jalview.io.FileLoader;
 import jalview.io.FormatAdapter;
 import jalview.io.IdentifyFile;
@@ -1186,29 +1185,9 @@ public class Desktop extends jalview.jbgui.GDesktop
       public void run()
       {
         File selectedFile = chooser.getSelectedFile();
-        Cache.setProperty("LAST_DIRECTORY", selectedFile.getParent());
-
         FileFormatI format = chooser.getSelectedFormat();
-
-        /*
-         * Call IdentifyFile to verify the file contains what its extension implies.
-         * Skip this step for dynamically added file formats, because IdentifyFile does
-         * not know how to recognise them.
-         */
-        if (FileFormats.getInstance().isIdentifiable(format))
-        {
-          try
-          {
-            format = new IdentifyFile().identify(selectedFile,
-                    DataSourceType.FILE);
-          } catch (FileFormatException e)
-          {
-            // format = null; //??
-          }
-        }
-
-        new FileLoader().LoadFile(viewport, selectedFile,
-                DataSourceType.FILE, format);
+        Cache.setProperty("LAST_DIRECTORY", selectedFile.getParent());
+        viewport.addFile(selectedFile, format);
       }
     });
     chooser.showOpenDialog(this);