From 0c31c56433b659e1f87b8100211bf9aeed102c9e Mon Sep 17 00:00:00 2001 From: ubbo Date: Tue, 11 May 2010 19:56:56 +0000 Subject: mimeparsing optional by settings git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@324 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgwin.cpp | 15 ++++++--------- gpgwin.h | 1 + 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/gpgwin.cpp b/gpgwin.cpp index 633e3b8..2fd7b32 100644 --- a/gpgwin.cpp +++ b/gpgwin.cpp @@ -69,8 +69,6 @@ GpgWin::GpgWin() void GpgWin::restoreSettings() { - QSettings settings; - // state sets pos & size of dock-widgets this->restoreState(settings.value("window/windowState").toByteArray()); @@ -323,8 +321,6 @@ void GpgWin::closeEvent(QCloseEvent *event) /** Save the settings */ - QSettings settings; - // window position and size settings.setValue("window/windowState", saveState()); settings.setValue("window/pos", pos()); @@ -502,14 +498,16 @@ void GpgWin::decrypt() preventNoDataErr(&text); mCtx->decrypt(text, tmp); if (!tmp->isEmpty()) { - // is it mime? TODO: parseMime should be optional by setting - parseMime(tmp); + // is it mime? + if(settings.value("mime/parseMime").toBool()) { + parseMime(tmp); + } edit->setPlainText(QString::fromUtf8(*tmp)); } } /** - * if this is mime, split text and attachents... + * if this is mime, split text and attachments... * message contains only text afterwards */ void GpgWin::parseMime(QByteArray *message) { @@ -648,7 +646,6 @@ void GpgWin::fileEncryption() } void GpgWin::openSettingsDialog() { - QSettings settings; new SettingsDialog(this); // restoreSettings(); // Iconsize @@ -656,6 +653,6 @@ void GpgWin::openSettingsDialog() this->setIconSize(iconSize); // Iconstyle - Qt::ToolButtonStyle buttonStyle = static_cast(settings.value("toolbar/iconstyle", Qt::ToolButtonTextUnderIcon).toUInt()); + Qt::ToolButtonStyle buttonStyle = static_cast(settings.value("toolbar/iconstyle", Qt::ToolButtonTextUnderIcon).toUInt()); this->setToolButtonStyle(buttonStyle); } diff --git a/gpgwin.h b/gpgwin.h index 9de17ed..60f6f13 100644 --- a/gpgwin.h +++ b/gpgwin.h @@ -145,6 +145,7 @@ private: QLabel *repeatpwLabel; QLabel *errorLabel; + QSettings settings; QString curFile; KeyList *mKeyList; Attachments *mAttachments; -- cgit v1.2.3