[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] [patch] korganizer - printing calendar item attachments
From:       "Ron Goodheart" <ron.goodheart () gmail ! com>
Date:       2008-09-05 5:39:38
Message-ID: 138cf8bd0809042239s674acd99taf518039a74f7c35 () mail ! gmail ! com
[Download RAW message or body]

Hi,
Another patch - smaller this time.
Hopefully without so many difficulties.
Figured there was more to do, might as well plug away at it.

Regards,
Ron

["calprintdefaultplugins-trunk.diff" (text/x-patch)]

Index: trunk/KDE/kdepim/korganizer/printing/calprintdefaultplugins.cpp
===================================================================
--- trunk/KDE/kdepim/korganizer/printing/calprintdefaultplugins.cpp	(revision 857243)
+++ trunk/KDE/kdepim/korganizer/printing/calprintdefaultplugins.cpp	(working copy)
@@ -608,11 +608,24 @@
     }
 
     if ( mShowAttachments ) {
-      int attachStart = drawBoxWithCaption( p, attachmentsBox,
-                        i18n( "Attachments:" ), QString(), /*sameLine=*/false,
-                        /*expand=*/false, captionFont, textFont );
-      // TODO: Print out the attachments somehow
-      Q_UNUSED( attachStart ); // until printing attachments is implemented
+      Attachment::List attachments = (*it)->attachments();
+      QString attachmentCaption;
+      if ( attachments.count() == 0 ) {
+        attachmentCaption = i18n( "No Attachments" );
+        txt.clear();
+      } else {
+        attachmentCaption = i18np( "1 Attachment:", "%1 Attachments:", \
attachments.count() ); +      }
+      QString attachmentString;
+      for ( Attachment::List::ConstIterator ait = attachments.begin(); ait != \
attachments.end(); ++ait ) { +        if (!attachmentString.isEmpty()) {
+          attachmentString += i18nc( "Spacer for the joined list of attachments", "  \
" ); +        }
+        attachmentString.append((*ait)->label());
+      }
+      drawBoxWithCaption( p, attachmentsBox,
+                        attachmentCaption, attachmentString, 
+                        /*sameLine=*/false, /*expand=*/false, captionFont, textFont \
);  }
     if ( mShowAttendees ) {
       Attendee::List attendees = (*it)->attendees();
@@ -634,7 +647,7 @@
                                  "%1 (%2): %3",
                                  (*ait)->fullName(), (*ait)->roleStr(), \
(*ait)->statusStr() );  }
-      drawBoxWithCaption( p, attendeesBox, i18n( "Attendees:" ), attendeeString,
+      drawBoxWithCaption( p, attendeesBox, attendeeCaption, attendeeString,
                           /*sameLine=*/false, /*expand=*/false, captionFont, \
textFont );  }
 



_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic