Commit 8c3efb6f authored by Laurent Montel's avatar Laurent Montel 😁

Clean up

parent 33216eb2
......@@ -90,7 +90,6 @@
#include <messageviewer/viewer/objecttreeparser.h>
#include <messageviewer/viewer/nodehelper.h>
//#include "messageviewer/chiasmuskeyselector.h"
#include <messageviewer/settings/globalsettings.h>
#include <messagecomposer/composer/composer.h>
#include <messagecomposer/part/globalpart.h>
......@@ -1393,19 +1392,6 @@ void KMComposeWin::setupActions( void )
mGenerateShortenUrl = mCustomToolsWidget->action(PimCommon::CustomToolsWidget::ShortUrlTool);
actionCollection()->addAction( QLatin1String("shorten_url"), mGenerateShortenUrl );
//Chiamus not supported in kmail2
#if 0
if ( Kleo::CryptoBackendFactory::instance()->protocol( QLatin1String("Chiasmus") ) ) {
KToggleAction *a = new KToggleAction( KIcon( "chiasmus_chi" ), i18n("Encrypt Message with Chiasmus..."), this );
actionCollection()->addAction( "encrypt_message_chiasmus", a );
a->setCheckedState( KGuiItem( i18n( "Encrypt Message with Chiasmus..." ), "chiencrypted" ) );
mEncryptChiasmusAction = a;
connect( mEncryptChiasmusAction, SIGNAL(toggled(bool)),
this, SLOT(slotEncryptChiasmusToggled(bool)) );
} else {
mEncryptChiasmusAction = 0;
}
#endif
mEncryptAction = new KToggleAction(KIcon(QLatin1String("document-encrypt")), i18n("&Encrypt Message"), this);
mEncryptAction->setIconText( i18n( "Encrypt" ) );
......@@ -3399,93 +3385,6 @@ void KMComposeWin::slotCursorPositionChanged()
}
}
#if 0
namespace {
class KToggleActionResetter {
KToggleAction *mAction;
bool mOn;
public:
KToggleActionResetter( KToggleAction *action, bool on )
: mAction( action ), mOn( on ) {}
~KToggleActionResetter() {
if ( mAction ) {
mAction->setChecked( mOn );
}
}
void disable() { mAction = 0; }
};
}
void KMComposeWin::slotEncryptChiasmusToggled( bool on )
{
if ( !on ) {
return;
}
KToggleActionResetter resetter( mEncryptChiasmusAction, false );
const Kleo::CryptoBackend::Protocol *chiasmus =
Kleo::CryptoBackendFactory::instance()->protocol( "Chiasmus" );
if ( !chiasmus ) {
const QString msg = Kleo::CryptoBackendFactory::instance()->knowsAboutProtocol( "Chiasmus" ) ?
i18n( "Please configure a Crypto Backend to use for "
"Chiasmus encryption first.\n"
"You can do this in the Crypto Backends tab of "
"the configure dialog's Security page." ) :
i18n( "It looks as though libkleopatra was compiled without "
"Chiasmus support. You might want to recompile "
"libkleopatra with --enable-chiasmus.");
KMessageBox::information( this, msg, i18n("No Chiasmus Backend Configured" ) );
return;
}
std::auto_ptr<Kleo::SpecialJob> job( chiasmus->specialJob( "x-obtain-keys", QMap<QString,QVariant>() ) );
if ( !job.get() ) {
const QString msg = i18n( "Chiasmus backend does not offer the "
"\"x-obtain-keys\" function. Please report this bug." );
KMessageBox::error( this, msg, i18n( "Chiasmus Backend Error" ) );
return;
}
if ( job->exec() ) {
job->showErrorDialog( this, i18n( "Chiasmus Backend Error" ) );
return;
}
const QVariant result = job->property( "result" );
if ( result.type() != QVariant::StringList ) {
const QString msg = i18n( "Unexpected return value from Chiasmus backend: "
"The \"x-obtain-keys\" function did not return a "
"string list. Please report this bug." );
KMessageBox::error( this, msg, i18n( "Chiasmus Backend Error" ) );
return;
}
const QStringList keys = result.toStringList();
if ( keys.empty() ) {
const QString msg = i18n( "No keys have been found. Please check that a "
"valid key path has been set in the Chiasmus "
"configuration." );
KMessageBox::information( this, msg, i18n( "No Chiasmus Keys Found" ) );
return;
}
MessageViewer::ChiasmusKeySelector selectorDlg( this, i18n( "Chiasmus Encryption Key Selection" ),
keys, GlobalSettings::chiasmusKey(),
GlobalSettings::chiasmusOptions() );
if ( selectorDlg.exec() != KDialog::Accepted ) {
return;
}
GlobalSettings::setChiasmusOptions( selectorDlg.options() );
GlobalSettings::setChiasmusKey( selectorDlg.key() );
assert( !GlobalSettings::chiasmusKey().isEmpty() );
resetter.disable();
}
#endif
void KMComposeWin::recipientEditorSizeHintChanged()
{
......
......@@ -414,8 +414,6 @@ private slots:
void slotPrintComposeResult( KJob *job );
//void slotEncryptChiasmusToggled( bool );
void slotSendFailed(const QString& msg , MessageComposer::ComposerViewBase::FailedType type);
void slotSendSuccessful(const QString &messageId);
......
......@@ -217,11 +217,6 @@
<default>true</default>
</entry>
<entry name="ChiasmusKey" type="String" key="chiasmus-key">
</entry>
<entry name="ChiasmusOptions" type="String" key="chiasmus-options">
</entry>
<entry name="ConfirmBeforeSend" type="Bool" key="confirm-before-send">
<label>Confirm &amp;before send</label>
<default>false</default>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment