summaryrefslogtreecommitdiffabout
path: root/libkcal/kincidenceformatter.cpp
authorzautrix <zautrix>2005-02-17 21:31:18 (UTC)
committer zautrix <zautrix>2005-02-17 21:31:18 (UTC)
commit8e8d2bd0c31eb272a7f26756252ff4930d0602bc (patch) (unidiff)
tree8392e9ca561d1444bcd949e9f1aaf78f698cde98 /libkcal/kincidenceformatter.cpp
parent002e4f8cea2352e4b9a046b98f66be946fbeb5fc (diff)
downloadkdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.zip
kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.gz
kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.bz2
fixes
Diffstat (limited to 'libkcal/kincidenceformatter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp46
1 files changed, 34 insertions, 12 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index cc3088a..1751ae3 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -10,13 +10,16 @@
10KIncidenceFormatter* KIncidenceFormatter::mInstance = 0; 10KIncidenceFormatter* KIncidenceFormatter::mInstance = 0;
11static KStaticDeleter<KIncidenceFormatter> insd; 11static KStaticDeleter<KIncidenceFormatter> insd;
12 12
13QString KIncidenceFormatter::getFormattedText( Incidence * inc ) 13QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified )
14{ 14{
15// #ifndef QT_NO_INPUTDIALOG 15// #ifndef QT_NO_INPUTDIALOG
16// return QInputDialog::getItem( caption, label, items, current, editable ); 16// return QInputDialog::getItem( caption, label, items, current, editable );
17// #else 17// #else
18// return QString::null; 18// return QString::null;
19// #endif 19// #endif
20 mDetails = details;
21 mCreated = created ;
22 mModified = modified;
20 mText = ""; 23 mText = "";
21 if ( inc->type() == "Event" ) 24 if ( inc->type() == "Event" )
22 setEvent((Event *) inc ); 25 setEvent((Event *) inc );
@@ -138,15 +141,26 @@ void KIncidenceFormatter::setEvent(Event *event)
138 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); 141 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
139 // mText.append(event->secrecyStr()+"<br>"); 142 // mText.append(event->secrecyStr()+"<br>");
140 formatCategories(event); 143 formatCategories(event);
141 if (!event->description().isEmpty()) { 144 if ( mDetails ) {
142 addTag("p",i18n("<b>Details: </b>")); 145 if (!event->description().isEmpty()) {
143 addTag("p",event->description()); 146 addTag("p",i18n("<b>Details: </b>"));
147 addTag("p",event->description());
148 }
144 } 149 }
145 150
146
147 formatReadOnly(event); 151 formatReadOnly(event);
148 formatAttendees(event); 152 formatAttendees(event);
149 153
154 if ( mCreated ) {
155 addTag("p",i18n("<b>Created: ") +" </b>");
156 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
157
158 }
159 if ( mModified ) {
160 addTag("p",i18n("<b>Last modified: ") +" </b>");
161 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
162
163 }
150 164
151} 165}
152 166
@@ -212,16 +226,24 @@ void KIncidenceFormatter::setTodo(Todo *event )
212 226
213 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); 227 addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
214 formatCategories(event); 228 formatCategories(event);
215 if (!event->description().isEmpty()) { 229 if ( mDetails ) {
216 addTag("p",i18n("<b>Details: </b>")); 230 if (!event->description().isEmpty()) {
217 addTag("p",event->description()); 231 addTag("p",i18n("<b>Details: </b>"));
232 addTag("p",event->description());
233 }
218 } 234 }
219
220
221
222 formatReadOnly(event); 235 formatReadOnly(event);
223 formatAttendees(event); 236 formatAttendees(event);
224 237 if ( mCreated ) {
238 addTag("p",i18n("<b>Created: ") +" </b>");
239 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
240
241 }
242 if ( mModified ) {
243 addTag("p",i18n("<b>Last modified: ") +" </b>");
244 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
245
246 }
225} 247}
226 248
227void KIncidenceFormatter::setJournal(Journal* ) 249void KIncidenceFormatter::setJournal(Journal* )