summaryrefslogtreecommitdiffstats
path: root/libkdepim/kvcarddrag.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /libkdepim/kvcarddrag.cpp
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/kvcarddrag.cpp')
-rw-r--r--libkdepim/kvcarddrag.cpp39
1 files changed, 37 insertions, 2 deletions
diff --git a/libkdepim/kvcarddrag.cpp b/libkdepim/kvcarddrag.cpp
index 2008f7a92..b8057367a 100644
--- a/libkdepim/kvcarddrag.cpp
+++ b/libkdepim/kvcarddrag.cpp
@@ -25,8 +25,11 @@
static const char vcard_mime_string[] = "text/x-vcard";
-KVCardDrag::KVCardDrag( const TQString &content, TQWidget *dragsource,
- const char *name )
+#if defined(KABC_VCARD_ENCODING_FIX)
+KVCardDrag::KVCardDrag( const TQByteArray &content, TQWidget *dragsource, const char *name )
+#else
+KVCardDrag::KVCardDrag( const TQString &content, TQWidget *dragsource, const char *name )
+#endif
: TQStoredDrag( vcard_mime_string, dragsource, name )
{
setVCard( content );
@@ -35,28 +38,60 @@ KVCardDrag::KVCardDrag( const TQString &content, TQWidget *dragsource,
KVCardDrag::KVCardDrag( TQWidget *dragsource, const char *name )
: TQStoredDrag( vcard_mime_string, dragsource, name )
{
+#if defined(KABC_VCARD_ENCODING_FIX)
+ setVCard( TQByteArray() );
+#else
setVCard( TQString::null );
+#endif
}
+#if defined(KABC_VCARD_ENCODING_FIX)
+void KVCardDrag::setVCard( const TQByteArray &content )
+{
+ setEncodedData( content );
+}
+#else
void KVCardDrag::setVCard( const TQString &content )
{
setEncodedData( content.utf8() );
}
+#endif
bool KVCardDrag::canDecode( TQMimeSource *e )
{
return e->provides( vcard_mime_string );
}
+#if defined(KABC_VCARD_ENCODING_FIX)
+bool KVCardDrag::decode( TQMimeSource *e, TQByteArray &content )
+{
+ if ( !canDecode( e ) ) {
+ return false;
+ }
+ content = e->encodedData( vcard_mime_string );
+ return true;
+}
+#else
bool KVCardDrag::decode( TQMimeSource *e, TQString &content )
{
+ if ( !canDecode( e ) ) {
+ return false;
+ }
content = TQString::fromUtf8( e->encodedData( vcard_mime_string ) );
return true;
}
+#endif
bool KVCardDrag::decode( TQMimeSource *e, KABC::Addressee::List& addressees )
{
+ if ( !canDecode( e ) ) {
+ return false;
+ }
+#if defined(KABC_VCARD_ENCODING_FIX)
+ addressees = KABC::VCardConverter().parseVCardsRaw( e->encodedData( vcard_mime_string ).data() );
+#else
addressees = KABC::VCardConverter().parseVCards( e->encodedData( vcard_mime_string ) );
+#endif
return true;
}