tui: fix meta/story use
[fanfix.git] / src / be / nikiroo / fanfix / reader / BasicReader.java
index 4b444940c11a07cfeb15a108171126c4bfe14baf..778b6338b108f847bea745fbe8fe04c77a0454ec 100644 (file)
@@ -71,7 +71,7 @@ public abstract class BasicReader implements Reader {
        }
 
        @Override
-       public MetaData getMeta() {
+       public synchronized MetaData getMeta() {
                return meta;
        }
 
@@ -91,18 +91,18 @@ public abstract class BasicReader implements Reader {
        }
 
        @Override
-       public synchronized void setMeta(URL source, Progress pg)
+       public synchronized void setMeta(URL url, Progress pg)
                        throws IOException {
-               BasicSupport support = BasicSupport.getSupport(source);
+               BasicSupport support = BasicSupport.getSupport(url);
                if (support == null) {
-                       throw new IOException("URL not supported: " + source.toString());
+                       throw new IOException("URL not supported: " + url.toString());
                }
 
-               story = support.process(source, pg);
+               story = support.process(pg);
                if (story == null) {
                        throw new IOException(
                                        "Cannot retrieve story from external source: "
-                                                       + source.toString());
+                                                       + url.toString());
                }
 
                meta = story.getMeta();
@@ -264,8 +264,11 @@ public abstract class BasicReader implements Reader {
        protected void start(File target, String program) throws IOException {
                if (program == null) {
                        boolean ok = false;
-                       for (String starter : new String[] { "xdg-open", "start", "run" }) {
+                       for (String starter : new String[] { "xdg-open", "open", "see",
+                                       "start", "run" }) {
                                try {
+                                       Instance.getTraceHandler().trace(
+                                                       "starting external program");
                                        Runtime.getRuntime().exec(
                                                        new String[] { starter, target.getAbsolutePath() });
                                        ok = true;
@@ -277,6 +280,7 @@ public abstract class BasicReader implements Reader {
                                throw new IOException("Cannot find a program to start the file");
                        }
                } else {
+                       Instance.getTraceHandler().trace("starting external program");
                        Runtime.getRuntime().exec(
                                        new String[] { program, target.getAbsolutePath() });
                }