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

List:       kmail-devel
Subject:    Re: Patch for IMAP Calendar and Exchange
From:       Bo Thorsen <bo () sonofthor ! dk>
Date:       2003-07-02 11:48:13
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 30 June 2003 17:19, Marc TAIEB wrote:
> Hello,
>
> I've created 2 patches for kmail.
> With them, you can consult with Korganizer your exchange calendar.

KMail people: The two patches attached were sent to the kde-pim list.

The kmgroupware.cpp looks fine to me, but I don't understand mimetypes, so
I can't really say anything for sure.

I have a couple of problems with the changes to kmailicalifaceimpl.cpp
though.

Index: kmailicalifaceimpl.cpp
===================================================================
RCS file: /home/taiebma/kde/cvsroot/kdepim/kmail/kmailicalifaceimpl.cpp,v
retrieving revision 1.12
diff -U1 -r1.12 kmailicalifaceimpl.cpp
- --- kmailicalifaceimpl.cpp	11 Jun 2003 11:06:30 -0000	1.12
+++ kmailicalifaceimpl.cpp	30 Jun 2003 15:12:27 -0000
@@ -30,2 +30,3 @@
 #include "kmfolderindex.h"
+#include "kmfolderimap.h"
 #include "kmmsgdict.h"
@@ -57,2 +58,3 @@
   QObject* gw = &kernel->groupware();
+  mFolderLanguage = 0;  //  default = english
   connect( gw, SIGNAL( signalRefresh( const QString& ) ),

Doesn't hurt, but it also doesn't do much. If the resource active, it will
be overridden in readConfig. If you do want to have this (valgrind?) then
please make it an initialization like the rest in the constructor chain.

@@ -120,4 +122,11 @@
     bool unget = !folder->isMessage(i);
- -    if( KMGroupware::vPartFoundAndDecoded( folder->getMsg( i ), s ) )
- -      ilist << s;
+    if (folder->folderType() == KMFolderTypeImap) {
+	KMFolderImap *imap = static_cast<KMFolderImap*>(folder);
+	if( KMGroupware::vPartFoundAndDecoded( imap->getMsg( i ), s ) )
+		ilist << s;
+    }
+    else {
+	if( KMGroupware::vPartFoundAndDecoded( folder->getMsg( i ), s ) )
+      		ilist << s;
+    }
     if( unget ) folder->unGetMsg(i);

This doesn't make sense to me at all. What are you trying to do? And why
are you even concerned with KMFolderImap when you say it only works for
KMFolderCachedImap?

@@ -258,3 +267,3 @@
 // For now: 0->English, 1->German
- -static QMap<KFolderTreeItem::Type,QString> folderNames[2];
+static QMap<KFolderTreeItem::Type,QString> folderNames[3];
 QString KMailICalIfaceImpl::folderName( KFolderTreeItem::Type type, int language ) const
@@ -289,2 +298,9 @@
     folderNames[1][KFolderTreeItem::Notes] = QString::fromLatin1("Notizen");
+
+    // French (TODO: Journals)
+    folderNames[2][KFolderTreeItem::Calendar] = QString::fromLatin1("Calendrier");
+    folderNames[2][KFolderTreeItem::Tasks] = QString::fromLatin1("Tâches");
+    folderNames[2][KFolderTreeItem::Journals] = QString::fromLatin1("Journal");
+    folderNames[2][KFolderTreeItem::Contacts] = QString::fromLatin1("Contacts");
+    folderNames[2][KFolderTreeItem::Notes] = QString::fromLatin1("Notes");
   }
@@ -347,3 +363,3 @@
   unsigned int folderLanguage = options.readNumEntry( "Folder Language", 0 );
- -  if( folderLanguage > 1 ) folderLanguage = 0;
+  if( folderLanguage > 2 ) folderLanguage = 0;
   QString parentName = options.readEntry("Folder Parent");

This change is fine. We really need it to be a standard localization of the
folder name at some point, but your patch looks fine. Except that there is
another if( folderLanguage... ) at line 292 (without your patch).

> Note that it only works with cachedimap.

I thought I removed this problem completely? What exactly does not work
without cached imap? It probably doesn't make sense at all to use KMail
as a storage resource unless it's dIMAP, but I still won't allow the thing
not to work with local folders. There is no coding tie to dIMAP, so if
it doesn't work, that would indicate a bug.

Bo.

- -- 

     Bo Thorsen                 |   Praestevejen 4
     Senior Software Engineer   |   5290 Marslev
     Klarälvdalens Datakonsult  |   Denmark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE/AsZ9mT99lwfUS5IRAnovAKCIxn5UF2TSPbHE0OImJSGc/S0JUwCbBXBD
bOV/VbKCrITo+DfAwRae47I=
=pC+P
-----END PGP SIGNATURE-----

["kmgroupware.cpp-patch" (text/x-diff)]

Index: kmgroupware.cpp
===================================================================
RCS file: /home/taiebma/kde/cvsroot/kdepim/kmail/kmgroupware.cpp,v
retrieving revision 1.31
diff -U1 -r1.31 kmgroupware.cpp
--- kmgroupware.cpp	26 Jun 2003 15:00:50 -0000	1.31
+++ kmgroupware.cpp	30 Jun 2003 15:07:04 -0000
@@ -142,3 +142,4 @@
   } else if( DwMime::kTypeMultipart == msg->type() &&
-	    DwMime::kSubtypeMixed  == msg->subtype() )
+	    (DwMime::kSubtypeMixed  == msg->subtype() ) ||
+	    (DwMime::kSubtypeAlternative  == msg->subtype() ))
   {
@@ -156,2 +157,12 @@
     }
+    else {
+	    dwPart = msg->findDwBodyPart( DwMime::kTypeText,
+			    DwMime::kSubtypeVCal );
+	    if (dwPart) {
+      		KMMessagePart msgPart;
+		KMMessage::bodyPart(dwPart, &msgPart);
+		s = msgPart.body();    
+		return true;
+	    }
+    }
   }else if( DwMime::kTypeMultipart == msg->type() &&


["kmailicalifaceimpl.cpp-patch" (text/x-diff)]

Index: kmailicalifaceimpl.cpp
===================================================================
RCS file: /home/taiebma/kde/cvsroot/kdepim/kmail/kmailicalifaceimpl.cpp,v
retrieving revision 1.12
diff -U1 -r1.12 kmailicalifaceimpl.cpp
--- kmailicalifaceimpl.cpp	11 Jun 2003 11:06:30 -0000	1.12
+++ kmailicalifaceimpl.cpp	30 Jun 2003 15:12:27 -0000
@@ -30,2 +30,3 @@
 #include "kmfolderindex.h"
+#include "kmfolderimap.h"
 #include "kmmsgdict.h"
@@ -57,2 +58,3 @@
   QObject* gw = &kernel->groupware();
+  mFolderLanguage = 0;  //  default = english
   connect( gw, SIGNAL( signalRefresh( const QString& ) ),
@@ -120,4 +122,11 @@
     bool unget = !folder->isMessage(i);
-    if( KMGroupware::vPartFoundAndDecoded( folder->getMsg( i ), s ) )
-      ilist << s;
+    if (folder->folderType() == KMFolderTypeImap) {
+	KMFolderImap *imap = static_cast<KMFolderImap*>(folder);
+	if( KMGroupware::vPartFoundAndDecoded( imap->getMsg( i ), s ) )
+		ilist << s;
+    }
+    else {			    
+	if( KMGroupware::vPartFoundAndDecoded( folder->getMsg( i ), s ) )
+      		ilist << s;
+    }
     if( unget ) folder->unGetMsg(i);
@@ -258,3 +267,3 @@
 // For now: 0->English, 1->German
-static QMap<KFolderTreeItem::Type,QString> folderNames[2];
+static QMap<KFolderTreeItem::Type,QString> folderNames[3];
 QString KMailICalIfaceImpl::folderName( KFolderTreeItem::Type type, int language ) const
@@ -289,2 +298,9 @@
     folderNames[1][KFolderTreeItem::Notes] = QString::fromLatin1("Notizen");
+
+    // French (TODO: Journals)
+    folderNames[2][KFolderTreeItem::Calendar] = QString::fromLatin1("Calendrier");
+    folderNames[2][KFolderTreeItem::Tasks] = QString::fromLatin1("Tâches");
+    folderNames[2][KFolderTreeItem::Journals] = QString::fromLatin1("Journal");
+    folderNames[2][KFolderTreeItem::Contacts] = QString::fromLatin1("Contacts");
+    folderNames[2][KFolderTreeItem::Notes] = QString::fromLatin1("Notes");
   }
@@ -347,3 +363,3 @@
   unsigned int folderLanguage = options.readNumEntry( "Folder Language", 0 );
-  if( folderLanguage > 1 ) folderLanguage = 0;
+  if( folderLanguage > 2 ) folderLanguage = 0;
   QString parentName = options.readEntry("Folder Parent");


_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://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