File r893953.diff of Package kdepimlibs4
Subject: kcal: inline attachment fixes
From: wstephenson@suse.de
Bug:
Patch-upstream: 893953
--- kcal/icalformat_p.cpp (revision 893952)
+++ kcal/icalformat_p.cpp (revision 893953)
@@ -1350,7 +1350,7 @@ Attachment *ICalFormatImpl::readAttachme
case ICAL_ATTACH_VALUE:
{
icalattach *a = icalproperty_get_attach( attach );
- if ( icalattach_get_is_url( a ) == 0 ) {
+ if ( !icalattach_get_is_url( a ) ) {
p = (const char *)icalattach_get_data( a );
if ( p ) {
attachment = new Attachment( p );
@@ -1908,9 +1908,8 @@ void ICalFormatImpl::readAlarm( icalcomp
ialarm->setRepeatCount( icalproperty_get_repeat( p ) );
break;
- // Only in DISPLAY and EMAIL and PROCEDURE alarms
case ICAL_DESCRIPTION_PROPERTY:
- {
+ { // Only in DISPLAY and EMAIL and PROCEDURE alarms
QString description = QString::fromUtf8( icalproperty_get_description( p ) );
switch ( action ) {
case ICAL_ACTION_DISPLAY:
--- kcal/attachment.cpp (revision 893952)
+++ kcal/attachment.cpp (revision 893953)
@@ -92,7 +92,7 @@ Attachment::Attachment( const QString &u
Attachment::Attachment( const char *base64, const QString &mime )
: d( new Attachment::Private( mime, true ) )
{
- setData( base64 );
+ d->mData = qstrdup( base64 );
}
Attachment::~Attachment()
--- kcal/tests/testattachment.cpp (revision 893952)
+++ kcal/tests/testattachment.cpp (revision 893953)
@@ -50,4 +50,12 @@ void AttachmentTest::testValidity()
Attachment attachment3( attachment2 );
QCOMPARE( attachment3.size(), attachment2.size() );
+
+ const char *fred = "jkajskldfasjfklasjfaskfaskfasfkasfjdasfkasjf";
+ Attachment attachment4( fred, "image/nonsense" );
+ QCOMPARE( fred, attachment4.data() );
+ QVERIFY( attachment4.isBinary() );
+ const char *ethel = "a9fafafjafkasmfasfasffksjklfjau";
+ attachment4.setData( ethel );
+ QCOMPARE( ethel, attachment4.data() );
}
Index: kcal/icalformat_p.cpp
===================================================================
Index: kcal/attachment.cpp
===================================================================
Index: kcal/tests/testattachment.cpp
===================================================================