From 7cc399eced74542bfd46621548495a966b203f62 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Wed, 12 Oct 2011 23:06:30 +0200 Subject: [PATCH] Imported Debian patch 1.5-2 --- debian/changelog | 6 ++++ debian/patches/proper-tempfiles | 61 +++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 68 insertions(+) create mode 100644 debian/patches/proper-tempfiles diff --git a/debian/changelog b/debian/changelog index ea48b02..e57559c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +minitube (1.5-2) unstable; urgency=low + + * Do proper temporary file createn (Closes: #644935) + + -- Jakob Haufe 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 index 0000000..a239aaa --- /dev/null +++ b/debian/patches/proper-tempfiles @@ -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 +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 + #include ++#include + #include + #include + #include "View.h" +@@ -130,6 +131,8 @@ private: + DownloadItem *downloadItem; + // QSlider *slider; + ++ QTemporaryFile *tempFile; ++ + }; + + #endif // __MEDIAVIEW_H__ diff --git a/debian/patches/series b/debian/patches/series index 4aa41e5..8e3a117 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ disable-update-check +proper-tempfiles -- 2.39.5