]> git.sur5r.net Git - minitube/commitdiff
Imported Debian patch 1.5-2 debian/1.5-2
authorJakob Haufe <sur5r@sur5r.net>
Wed, 12 Oct 2011 21:06:30 +0000 (23:06 +0200)
committerJakob Haufe <sur5r@sur5r.net>
Mon, 6 Aug 2012 20:31:45 +0000 (22:31 +0200)
debian/changelog
debian/patches/proper-tempfiles [new file with mode: 0644]
debian/patches/series

index ea48b02da76880c3bc1f40a748480c52be579bf6..e57559c0adf1f32cc9c57672b21e3d9bd0ec2001 100644 (file)
@@ -1,3 +1,9 @@
+minitube (1.5-2) unstable; urgency=low
+
+  * Do proper temporary file createn (Closes: #644935)
+
+ -- Jakob Haufe <sur5r@sur5r.net>  Wed, 12 Oct 2011 23:06:30 +0200
+
 minitube (1.5-1.1) unstable; urgency=low
 
   * Bump Standards-Version to 3.9.2 (no changes required)
diff --git a/debian/patches/proper-tempfiles b/debian/patches/proper-tempfiles
new file mode 100644 (file)
index 0000000..a239aaa
--- /dev/null
@@ -0,0 +1,61 @@
+Description: Do proper temporary file creation
+ Upstream is using predictable temporary file names. Fix this in Debian
+ for now by using QTemporaryFile. This additionally ensures removal of
+ temporary files upon exit.
+Author: Jakob Haufe <sur5r@sur5r.net>
+Bug-Debian: http://bugs.debian.org/644935
+
+--- minitube-1.5.orig/src/MediaView.cpp
++++ minitube-1.5/src/MediaView.cpp
+@@ -127,6 +127,7 @@ MediaView::MediaView(QWidget *parent) :
+     connect(demoTimer, SIGNAL(timeout()), SLOT(demoMessage()));
+ #endif
++    tempFile = new QTemporaryFile(this);
+ }
+ void MediaView::initialize() {
+@@ -346,21 +347,15 @@ void MediaView::gotStreamUrl(QUrl stream
+     QString tempDir = QDesktopServices::storageLocation(QDesktopServices::TempLocation);
+-#ifdef Q_WS_X11
+-    QString tempFile = tempDir + "/minitube-" + getenv("USERNAME") + ".mp4";
+-#else
+-    QString tempFile = tempDir + "/minitube.mp4";
+-#endif
+-    if (QFile::exists(tempFile) && !QFile::remove(tempFile)) {
+-        qDebug() << "Cannot remove temp file";
+-    }
++    if(tempFile->fileName().isNull())
++        tempFile->open();
+     Video *videoCopy = video->clone();
+     if (downloadItem) {
+         downloadItem->stop();
+         delete downloadItem;
+     }
+-    downloadItem = new DownloadItem(videoCopy, streamUrl, tempFile, this);
++    downloadItem = new DownloadItem(videoCopy, streamUrl, tempFile->fileName(), this);
+     connect(downloadItem, SIGNAL(statusChanged()), SLOT(downloadStatusChanged()));
+     // connect(downloadItem, SIGNAL(progress(int)), SLOT(downloadProgress(int)));
+     connect(downloadItem, SIGNAL(bufferProgress(int)), loadingWidget, SLOT(bufferStatus(int)));
+--- minitube-1.5.orig/src/MediaView.h
++++ minitube-1.5/src/MediaView.h
+@@ -3,6 +3,7 @@
+ #include <QtGui>
+ #include <QtNetwork>
++#include <QTemporaryFile>
+ #include <phonon/mediaobject.h>
+ #include <phonon/videowidget.h>
+ #include "View.h"
+@@ -130,6 +131,8 @@ private:
+     DownloadItem *downloadItem;
+     // QSlider *slider;
++    QTemporaryFile *tempFile;
++
+ };
+ #endif // __MEDIAVIEW_H__
index 4aa41e5988bc6e21fc023d58329895cf20dc8142..8e3a1178dfc63dbd9ea6e5dd48e76e78cb14c0f6 100644 (file)
@@ -1 +1,2 @@
 disable-update-check
+proper-tempfiles