From 9e6e8b49b0f94f5698431fd7f83ab0f562f9c576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 9 Jun 2011 08:48:05 +0000 Subject: [PATCH] using QTemporaryFile::createLocalFile; closes #69 --- swisssurfer/src/browser.hxx | 10 ++++++---- swisssurfer/src/swisssurfer_de.ts | 6 +++--- swisssurfer/src/swisssurfer_en.ts | 6 +++--- swisssurfer/src/swisssurfer_fr.ts | 6 +++--- swisssurfer/src/swisssurfer_it.ts | 6 +++--- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/swisssurfer/src/browser.hxx b/swisssurfer/src/browser.hxx index a19b694..d7c41cc 100644 --- a/swisssurfer/src/browser.hxx +++ b/swisssurfer/src/browser.hxx @@ -1061,10 +1061,12 @@ class Browser: public QMainWindow, protected Ui::Browser { if (!type.isEmpty()) { filename.replace(QRegExp("^(.*)\\."+type.at(0)+"$"), "\\1"); // remove extension - QTemporaryFile *file = - new QTemporaryFile(QDir::tempPath()+QDir::separator() - +filename+"_XXXXXX." - +type.at(0), this); + QTemporaryFile *file(QTemporaryFile::createLocalFile + (QDir::tempPath()+QDir::separator() + +filename+"."+type.at(0))); + if (!file) file = new QTemporaryFile(QDir::tempPath()+QDir::separator() + +filename+"_XXXXXX." + +type.at(0), this); file->open(); file->write(reply->readAll()); file->close(); diff --git a/swisssurfer/src/swisssurfer_de.ts b/swisssurfer/src/swisssurfer_de.ts index 5afb30b..960f26b 100644 --- a/swisssurfer/src/swisssurfer_de.ts +++ b/swisssurfer/src/swisssurfer_de.ts @@ -351,17 +351,17 @@ Compiled: qt-%5 - + Save File As ... - + authentication required - + ssl error diff --git a/swisssurfer/src/swisssurfer_en.ts b/swisssurfer/src/swisssurfer_en.ts index 47ba2b5..a45dd45 100644 --- a/swisssurfer/src/swisssurfer_en.ts +++ b/swisssurfer/src/swisssurfer_en.ts @@ -341,17 +341,17 @@ Compiled: qt-%5 - + Save File As ... - + authentication required - + ssl error diff --git a/swisssurfer/src/swisssurfer_fr.ts b/swisssurfer/src/swisssurfer_fr.ts index 5afb30b..960f26b 100644 --- a/swisssurfer/src/swisssurfer_fr.ts +++ b/swisssurfer/src/swisssurfer_fr.ts @@ -351,17 +351,17 @@ Compiled: qt-%5 - + Save File As ... - + authentication required - + ssl error diff --git a/swisssurfer/src/swisssurfer_it.ts b/swisssurfer/src/swisssurfer_it.ts index 5afb30b..960f26b 100644 --- a/swisssurfer/src/swisssurfer_it.ts +++ b/swisssurfer/src/swisssurfer_it.ts @@ -351,17 +351,17 @@ Compiled: qt-%5 - + Save File As ... - + authentication required - + ssl error