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

List:       kmail-devel
Subject:    [Bug 68332] Actions shown in message view for iCalendar attachments
From:       Cornelius Schumacher <schumacher () kde ! org>
Date:       2003-11-25 22:26:31
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
     
http://bugs.kde.org/show_bug.cgi?id=68332     
schumacher@kde.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From schumacher@kde.org  2003-11-25 23:26 -------
Subject: kdepim/kmail

CVS commit by cschumac: 

Correctly pass iCalendar attachments to KOrganizer. This replaces the
functionality of the korganizerIn script. Patch reviewed by Bo.

CCMAIL: 68332-done@bugs.kde.org


  M +2 -1      kmgroupware.cpp   1.51
  M +35 -0     objecttreeparser.cpp   1.89


--- kdepim/kmail/kmgroupware.cpp  #1.50:1.51
@@ -529,5 +529,6 @@ bool KMGroupware::vPartToHTML( int /*aUp
 
   // show the 'buttons' (only if in groupware mode)
-  if( mUseGroupware ) {
+  // Disable buttons. This is handled in KOrganizer.
+  if( false && mUseGroupware ) {
     prefix.append( "<br>&nbsp;<br>&nbsp;<br><table border=\"0\" \
cellspacing=\"0\"><tr><td>&nbsp;</td><td>" );  if( sMethod == "request" || sMethod == \
"update" ) {

--- kdepim/kmail/objecttreeparser.cpp  #1.88:1.89
@@ -66,4 +66,7 @@
 #include <khtml_part.h>
 #include <ktempfile.h>
+#include <kstandarddirs.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
 
 // other Qt headers
@@ -822,4 +825,35 @@ QString ObjectTreeParser::byteArrayToTem
       return false;
 
+    QString vCal( curNode->msgPart().bodyToUnicode() );
+    QString prefix;
+    QString postfix;
+    // We let KMGroupware do most of our 'print formatting':
+    // generates text preceding to and following to the vCal
+    if ( kmkernel->groupware().vPartToHTML( KMGroupware::NoUpdateCounter,
+                                            vCal, QString::null, prefix,
+                                            postfix ) ) {
+      htmlWriter()->queue( prefix );
+      htmlWriter()->queue( quotedHTML( vCal ) );
+      htmlWriter()->queue( postfix );
+    }
+
+    // Pass iTIP message to KOrganizer
+    QString location = locateLocal( "data", "korganizer/income/", true );
+    QString file = location + KApplication::randomString( 10 );
+    QFile f( file );
+    if ( !f.open( IO_WriteOnly ) ) {
+      KMessageBox::error( mReader, i18n("Could not open file for writing:\n%1")
+                                   .arg( file ) );
+    } else {
+      QByteArray msgArray = curNode->msgPart().bodyDecodedBinary();
+      f.writeBlock( msgArray, msgArray.size() );
+      f.close();
+    }
+
+    return true;
+
+// Disable kroupware code, because KOrganizer counterpart code also is disabled.
+// Analyzing of iCalendar attachments belongs into KOrganizer anyway.
+#if 0
     DwMediaType ct = curNode->dwPart()->Headers().ContentType();
     for( DwParameter * param = ct.FirstParameter(); param;
@@ -856,4 +890,5 @@ QString ObjectTreeParser::byteArrayToTem
     }
     return false;
+#endif  
   }
_______________________________________________
KMail Developers mailing list
kmail@kde.org
https://mail.kde.org/mailman/listinfo/kmail


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

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