[mythtv] [patch] Allow mythfilldatabase to read from stdin

Jonathan Kolb jkolb-mythtv at greyshift.net
Tue Jun 24 18:33:30 EDT 2003


This patch allows mythfilldatabase --file <sourceid> <offset> - to read from
stdin.  This way, I don't have to use an intermediate file to use
mythgetppv.pl, I can just pipe them together.

Jon

Index: filldata.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfilldatabase/filldata.cpp,v
retrieving revision 1.49
diff -u -r1.49 filldata.cpp
--- filldata.cpp        23 Jun 2003 06:37:41 -0000      1.49
+++ filldata.cpp        24 Jun 2003 21:30:23 -0000
@@ -478,10 +478,19 @@
                QMap<QString, QValueList<ProgInfo> > *proglist)
 {
     QDomDocument doc;
-    QFile f(filename);
+    QFile f;

-    if (!f.open(IO_ReadOnly))
-        return;
+    if (filename.compare("-"))
+    {
+        f.setName(filename);
+        if (!f.open(IO_ReadOnly))
+            return;
+    }
+    else
+    {
+        if (!f.open(IO_ReadOnly, stdin))
+            return;
+    }

     QString errorMsg = "unknown";
     int errorLine = 0;



More information about the mythtv-dev mailing list