From 0af0baddfd77fb6cabd8dd17f43ffb87d4262afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Mon, 23 May 2011 09:08:06 +0000 Subject: [PATCH] closes #50 --- swisssurfer/src/browser.hxx | 22 ++++++++++++---------- swisssurfer/src/settings.hxx | 2 ++ swisssurfer/src/settings.ui | 7 +++++-- swisssurfer/src/swisssurfer_de.ts | 4 ++-- swisssurfer/src/swisssurfer_en.ts | 4 ++-- swisssurfer/src/swisssurfer_fr.ts | 4 ++-- swisssurfer/src/swisssurfer_it.ts | 4 ++-- 7 files changed, 27 insertions(+), 20 deletions(-) diff --git a/swisssurfer/src/browser.hxx b/swisssurfer/src/browser.hxx index f5b28e6..190c449 100644 --- a/swisssurfer/src/browser.hxx +++ b/swisssurfer/src/browser.hxx @@ -115,14 +115,15 @@ class Browser: public QMainWindow, protected Ui::Browser { ~Browser() { LOG; - for (DownloadProcesses::iterator it(_downloadProcesses.begin()); - it!=_downloadProcesses.end(); ++it) { - LOG<<"delete:"<second->fileName(); - delete it->second; - it->second = 0; - it->first->terminate(); - delete it->first; - } + if (_settings.flag("CloseApps")) + for (DownloadProcesses::iterator it(_downloadProcesses.begin()); + it!=_downloadProcesses.end(); ++it) { + LOG<<"delete:"<second->fileName(); + delete it->second; + it->second = 0; + it->first->terminate(); + delete it->first; + } } //! Whitelisting @@ -1020,7 +1021,7 @@ class Browser: public QMainWindow, protected Ui::Browser { if (it!=_settings.mimetypes().end()) { QTemporaryFile *file = new QTemporaryFile(QDir::tempPath()+QDir::separator() - +"swisssurferXXXXXX." + +"swisssurferXXXXXX" +it.value().toStringList().at(0), this); file->open(); file->write(reply->readAll()); @@ -1051,7 +1052,8 @@ class Browser: public QMainWindow, protected Ui::Browser { void processFinished() { LOG; - delete _downloadProcesses[qobject_cast(sender())]; + if (_settings.flag("CloseApps")) + delete _downloadProcesses[qobject_cast(sender())]; _downloadProcesses.erase(qobject_cast(sender())); } diff --git a/swisssurfer/src/settings.hxx b/swisssurfer/src/settings.hxx index 77d845d..2d754d2 100644 --- a/swisssurfer/src/settings.hxx +++ b/swisssurfer/src/settings.hxx @@ -87,6 +87,8 @@ class Settings: public QDialog, protected Ui::Settings { // CheckBoxes _checkboxes["SaveWindowState"] = std::make_pair(_saveWindowState, _saveWindowState->isChecked()); + _checkboxes["CloseApps"] = + std::make_pair(_closeApps, _closeApps->isChecked()); load(!_mimetypes.size()); on__buttons_rejected(); diff --git a/swisssurfer/src/settings.ui b/swisssurfer/src/settings.ui index da46ffc..8f71624 100644 --- a/swisssurfer/src/settings.ui +++ b/swisssurfer/src/settings.ui @@ -17,7 +17,7 @@ - 2 + 4 @@ -653,11 +653,14 @@ p, li { white-space: pre-wrap; } + + true + close mimetype helper applications on exit - true + false diff --git a/swisssurfer/src/swisssurfer_de.ts b/swisssurfer/src/swisssurfer_de.ts index 2509dc9..376461a 100644 --- a/swisssurfer/src/swisssurfer_de.ts +++ b/swisssurfer/src/swisssurfer_de.ts @@ -331,12 +331,12 @@ Compiled: qt-%5 - + authentication required - + ssl error diff --git a/swisssurfer/src/swisssurfer_en.ts b/swisssurfer/src/swisssurfer_en.ts index 2509dc9..376461a 100644 --- a/swisssurfer/src/swisssurfer_en.ts +++ b/swisssurfer/src/swisssurfer_en.ts @@ -331,12 +331,12 @@ Compiled: qt-%5 - + authentication required - + ssl error diff --git a/swisssurfer/src/swisssurfer_fr.ts b/swisssurfer/src/swisssurfer_fr.ts index 2509dc9..376461a 100644 --- a/swisssurfer/src/swisssurfer_fr.ts +++ b/swisssurfer/src/swisssurfer_fr.ts @@ -331,12 +331,12 @@ Compiled: qt-%5 - + authentication required - + ssl error diff --git a/swisssurfer/src/swisssurfer_it.ts b/swisssurfer/src/swisssurfer_it.ts index 2509dc9..376461a 100644 --- a/swisssurfer/src/swisssurfer_it.ts +++ b/swisssurfer/src/swisssurfer_it.ts @@ -331,12 +331,12 @@ Compiled: qt-%5 - + authentication required - + ssl error