From bea671de8d2b330b9d9435e4152ee7ff0e532e65 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Wed, 17 Dec 2008 15:21:31 +0000 Subject: [PATCH] Don't allow attachment deletion/editing in read-only folders. Kolab issue 3324 svn path=/branches/kdepim/enterprise/kdepim/; revision=898161 --- kmreaderwin.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kmreaderwin.cpp b/kmreaderwin.cpp index 9b500334f..7de13bd57 100644 --- a/kmreaderwin.cpp +++ b/kmreaderwin.cpp @@ -1969,9 +1969,10 @@ void KMReaderWin::showAttachmentPopup( int id, const QString & name, const QPoin menu->insertItem(i18n("to view something", "View"), 3); menu->insertItem(SmallIcon("filesaveas"),i18n("Save As..."), 4); menu->insertItem(SmallIcon("editcopy"), i18n("Copy"), 9 ); - if ( GlobalSettings::self()->allowAttachmentEditing() ) + const bool canChange = message()->parent() ? !message()->parent()->isReadOnly() : false; + if ( GlobalSettings::self()->allowAttachmentEditing() && canChange ) menu->insertItem(SmallIcon("edit"), i18n("Edit Attachment"), 8 ); - if ( GlobalSettings::self()->allowAttachmentDeletion() ) + if ( GlobalSettings::self()->allowAttachmentDeletion() && canChange ) menu->insertItem(SmallIcon("editdelete"), i18n("Delete Attachment"), 7 ); if ( name.endsWith( ".xia", false ) && Kleo::CryptoBackendFactory::instance()->protocol( "Chiasmus" ) ) @@ -2692,7 +2693,7 @@ void KMReaderWin::injectAttachments() } assert( injectionPoint.tagName() == "div" ); - static_cast( injectionPoint ).setInnerHTML( html ); + static_cast( injectionPoint ).setInnerHTML( html ); } static QColor nextColor( const QColor & c )