All pastes #1249645 Raw Edit

Anonymous

public text v1 · immutable
#1249645 ·published 2008-11-09 17:49 UTC
rendered paste body
Index: mythtv/libs/libmythtv/previewgenerator.cpp
===================================================================
--- mythtv/libs/libmythtv/previewgenerator.cpp	(revision 18987)
+++ mythtv/libs/libmythtv/previewgenerator.cpp	(working copy)
@@ -16,6 +16,7 @@
 #include <QImage>
 #include <QMetaType>
 #include <QUrl>
+#include <QDir>
 
 // MythTV headers
 #include "RingBuffer.h"
@@ -137,9 +138,11 @@
     QMutexLocker locker(&previewLock);
     qRegisterMetaType<bool>("bool &");
     connect(this, SIGNAL(previewThreadDone(const QString&,bool&)),
-            obj,  SLOT(  previewThreadDone(const QString&,bool&)));
+            obj,  SLOT(  previewThreadDone(const QString&,bool&)),
+            Qt::DirectConnection);
     connect(this, SIGNAL(previewReady(const ProgramInfo*)),
-            obj,  SLOT(  previewReady(const ProgramInfo*)));
+            obj,  SLOT(  previewReady(const ProgramInfo*)),
+            Qt::DirectConnection);
     isConnected = true;
 }
 
@@ -355,8 +358,17 @@
     }
 
     if (outFileName.isEmpty())
-        return true;
+    {
+        QString remotecachedirname = QString("%1/remotecache").arg(GetConfDir());
+        QDir remotecachedir(remotecachedirname);
 
+        if (!remotecachedir.exists())
+            remotecachedir.mkdir(remotecachedirname);
+
+        QString filename = programInfo.pathname.section('/',-1) + ".png";
+        outFileName = QString("%1/%2").arg(remotecachedirname).arg(filename);
+    }
+
     // find file, copy/move to output file name & location...
 
     QString url = QString::null;
@@ -364,7 +376,7 @@
     QByteArray data;
     ok = false;
 
-    QStringList fileNames; 
+    QStringList fileNames;
     fileNames.push_back(CreateAccessibleFilename(programInfo.pathname, fn));
     fileNames.push_back(CreateAccessibleFilename(programInfo.pathname, ""));