author | zautrix <zautrix> | 2005-07-30 16:17:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-30 16:17:54 (UTC) |
commit | 6a32c95e5f0a36cd9a681a3f3302bec6e83acce5 (patch) (unidiff) | |
tree | 3f8da30f9fe779ae697c97e16eb4dd6f47c3ed00 | |
parent | 9ca2cd947f22d33543e065f54c6487e86d80befa (diff) | |
download | kdepimpi-6a32c95e5f0a36cd9a681a3f3302bec6e83acce5.zip kdepimpi-6a32c95e5f0a36cd9a681a3f3302bec6e83acce5.tar.gz kdepimpi-6a32c95e5f0a36cd9a681a3f3302bec6e83acce5.tar.bz2 |
fixx
-rw-r--r-- | libkcal/attachment.cpp | 38 | ||||
-rw-r--r-- | libkcal/attachment.h | 51 | ||||
-rw-r--r-- | libkcal/icalformatimpl.cpp | 4 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 10 |
4 files changed, 85 insertions, 18 deletions
diff --git a/libkcal/attachment.cpp b/libkcal/attachment.cpp index 1ead923..520ac95 100644 --- a/libkcal/attachment.cpp +++ b/libkcal/attachment.cpp | |||
@@ -1,4 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | |||
3 | Copyright (c) 2002 Michael Brade <brade@kde.org> | 4 | Copyright (c) 2002 Michael Brade <brade@kde.org> |
4 | 5 | ||
@@ -23,4 +24,13 @@ | |||
23 | using namespace KCal; | 24 | using namespace KCal; |
24 | 25 | ||
26 | Attachment::Attachment( const Attachment &attachment) | ||
27 | { | ||
28 | mMimeType = attachment.mMimeType; | ||
29 | mData = attachment.mData; | ||
30 | mBinary = attachment.mBinary; | ||
31 | mShowInline = attachment.mShowInline; | ||
32 | mLabel = attachment.mLabel; | ||
33 | } | ||
34 | |||
25 | Attachment::Attachment(const QString& uri, const QString& mime) | 35 | Attachment::Attachment(const QString& uri, const QString& mime) |
26 | { | 36 | { |
@@ -28,4 +38,6 @@ Attachment::Attachment(const QString& uri, const QString& mime) | |||
28 | mData = uri; | 38 | mData = uri; |
29 | mBinary = false; | 39 | mBinary = false; |
40 | mShowInline = false; | ||
41 | mLabel = QString::null; | ||
30 | } | 42 | } |
31 | 43 | ||
@@ -35,7 +47,9 @@ Attachment::Attachment(const char *base64, const QString& mime) | |||
35 | mData = QString::fromUtf8(base64); | 47 | mData = QString::fromUtf8(base64); |
36 | mBinary = true; | 48 | mBinary = true; |
49 | mShowInline = false; | ||
50 | mLabel = QString::null; | ||
37 | } | 51 | } |
38 | 52 | ||
39 | bool Attachment::isURI() const | 53 | bool Attachment::isUri() const |
40 | { | 54 | { |
41 | return !mBinary; | 55 | return !mBinary; |
@@ -50,5 +64,5 @@ QString Attachment::uri() const | |||
50 | } | 64 | } |
51 | 65 | ||
52 | void Attachment::setURI(const QString& uri) | 66 | void Attachment::setUri(const QString& uri) |
53 | { | 67 | { |
54 | mData = uri; | 68 | mData = uri; |
@@ -85,2 +99,22 @@ void Attachment::setMimeType(const QString& mime) | |||
85 | } | 99 | } |
86 | 100 | ||
101 | bool Attachment::showInline() const | ||
102 | { | ||
103 | return mShowInline; | ||
104 | } | ||
105 | |||
106 | void Attachment::setShowInline( bool showinline ) | ||
107 | { | ||
108 | mShowInline = showinline; | ||
109 | } | ||
110 | |||
111 | QString Attachment::label() const | ||
112 | { | ||
113 | return mLabel; | ||
114 | } | ||
115 | |||
116 | void Attachment::setLabel( const QString& label ) | ||
117 | { | ||
118 | mLabel = label; | ||
119 | } | ||
120 | |||
diff --git a/libkcal/attachment.h b/libkcal/attachment.h index cdf2458..5301420 100644 --- a/libkcal/attachment.h +++ b/libkcal/attachment.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | |||
3 | Copyright (c) 2002 Michael Brade <brade@kde.org> | 4 | Copyright (c) 2002 Michael Brade <brade@kde.org> |
4 | 5 | ||
@@ -18,37 +19,47 @@ | |||
18 | Boston, MA 02111-1307, USA. | 19 | Boston, MA 02111-1307, USA. |
19 | */ | 20 | */ |
21 | #ifndef KCAL_ATTACHMENT_H | ||
22 | #define KCAL_ATTACHMENT_H | ||
20 | 23 | ||
21 | #ifndef _ATTACHMENT_H | ||
22 | #define _ATTACHMENT_H | ||
23 | 24 | ||
24 | #include <qstring.h> | ||
25 | 25 | ||
26 | #include <qstring.h> | ||
26 | 27 | ||
27 | namespace KCal { | 28 | namespace KCal { |
28 | 29 | ||
29 | /** | 30 | /** |
30 | * This class represents information related to an attachment. | 31 | This class represents information related to an attachment. |
31 | */ | 32 | */ |
32 | class Attachment | 33 | class Attachment |
33 | { | 34 | { |
34 | public: | 35 | public: |
36 | |||
37 | /** | ||
38 | Create a Reference to some URI by copying an existing Attachment. | ||
39 | |||
40 | @param attachment the attachment to be duplicated | ||
41 | */ | ||
42 | Attachment( const Attachment &attachment ); | ||
43 | |||
35 | /** | 44 | /** |
36 | * Create a Reference to some URI. | 45 | Create a Reference to some URI. |
37 | * @param uri the uri this attachment refers to | 46 | |
38 | * @param mime the mime type of the resource being linked to | 47 | @param uri the uri this attachment refers to |
48 | @param mime the mime type of the resource being linked to | ||
39 | */ | 49 | */ |
40 | Attachment(const QString& uri, const QString& mime = QString::null); | 50 | Attachment(const QString& uri, const QString& mime = QString::null); |
41 | 51 | ||
42 | /** | 52 | /** |
43 | * Create a binary attachment. | 53 | Create a binary attachment. |
44 | * @param base64 the attachment in base64 format | 54 | |
45 | * @param mime the mime type of the attachment | 55 | @param base64 the attachment in base64 format |
56 | @param mime the mime type of the attachment | ||
46 | */ | 57 | */ |
47 | Attachment(const char *base64, const QString& mime = QString::null); | 58 | Attachment(const char *base64, const QString& mime = QString::null); |
48 | 59 | ||
49 | /* The VALUE parameter in Cal */ | 60 | /* The VALUE parameter in iCal */ |
50 | bool isURI() const; | 61 | bool isUri() const; |
51 | QString uri() const; | 62 | QString uri() const; |
52 | void setURI(const QString& uri); | 63 | void setUri( const QString &uri ); |
53 | 64 | ||
54 | bool isBinary() const; | 65 | bool isBinary() const; |
@@ -59,8 +70,22 @@ public: | |||
59 | QString mimeType() const; | 70 | QString mimeType() const; |
60 | void setMimeType(const QString& mime); | 71 | void setMimeType(const QString& mime); |
72 | |||
73 | /* The custom X-CONTENT-DISPOSITION parameter, used by OGo etc. */ | ||
74 | bool showInline() const; | ||
75 | void setShowInline( bool showinline ); | ||
76 | |||
77 | /* The custom X-LABEL parameter to show a human-readable title */ | ||
78 | QString label() const; | ||
79 | void setLabel( const QString &label ); | ||
80 | |||
61 | private: | 81 | private: |
62 | QString mMimeType; | 82 | QString mMimeType; |
63 | QString mData; | 83 | QString mData; |
64 | bool mBinary; | 84 | bool mBinary; |
85 | bool mShowInline; | ||
86 | QString mLabel; | ||
87 | |||
88 | class Private; | ||
89 | Private *d; | ||
65 | }; | 90 | }; |
66 | 91 | ||
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index 53aa039..65eabc8 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp | |||
@@ -515,5 +515,5 @@ icalproperty *ICalFormatImpl::writeAttachment(Attachment *att) | |||
515 | #if 0 | 515 | #if 0 |
516 | icalattachtype* attach = icalattachtype_new(); | 516 | icalattachtype* attach = icalattachtype_new(); |
517 | if (att->isURI()) | 517 | if (att->isUri()) |
518 | icalattachtype_set_url(attach, att->uri().utf8().data()); | 518 | icalattachtype_set_url(attach, att->uri().utf8().data()); |
519 | else | 519 | else |
@@ -521,5 +521,5 @@ icalproperty *ICalFormatImpl::writeAttachment(Attachment *att) | |||
521 | #endif | 521 | #endif |
522 | icalattach *attach; | 522 | icalattach *attach; |
523 | if (att->isURI()) | 523 | if (att->isUri()) |
524 | attach = icalattach_new_from_url( att->uri().utf8().data()); | 524 | attach = icalattach_new_from_url( att->uri().utf8().data()); |
525 | else | 525 | else |
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 549014e..39c14f5 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -60,5 +60,12 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) | |||
60 | // QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations; | 60 | // QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations; |
61 | mExDates = i.mExDates; | 61 | mExDates = i.mExDates; |
62 | mAttachments = i.mAttachments; | 62 | QPtrListIterator<Attachment> itat( i.mAttachments ); |
63 | Attachment *at; | ||
64 | while( (at = itat.current()) ) { | ||
65 | Attachment *a = new Attachment( *at ); | ||
66 | mAttachments.append( a ); | ||
67 | ++itat; | ||
68 | } | ||
69 | mAttachments.setAutoDelete( true ); | ||
63 | mResources = i.mResources; | 70 | mResources = i.mResources; |
64 | mSecrecy = i.mSecrecy; | 71 | mSecrecy = i.mSecrecy; |
@@ -758,4 +765,5 @@ Recurrence *Incidence::recurrence() | |||
758 | mRecurrence = new Recurrence(this); | 765 | mRecurrence = new Recurrence(this); |
759 | mRecurrence->setRecurStart( dtStart() ); | 766 | mRecurrence->setRecurStart( dtStart() ); |
767 | mRecurrence->setRecurReadOnly( isReadOnly()); | ||
760 | //qDebug("creating new recurence "); | 768 | //qDebug("creating new recurence "); |
761 | //abort(); | 769 | //abort(); |