From kmail-devel Wed Jul 02 11:48:13 2003 From: Bo Thorsen Date: Wed, 02 Jul 2003 11:48:13 +0000 To: kmail-devel Subject: Re: Patch for IMAP Calendar and Exchange X-MARC-Message: https://marc.info/?l=kmail-devel&m=105714648030270 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_9ZsA/qGu2ap59R3" --Boundary-00=_9ZsA/qGu2ap59R3 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline =2D----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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/taiebma/kde/cvsroot/kdepim/kmail/kmailicalifaceimpl.cpp,v retrieving revision 1.12 diff -U1 -r1.12 kmailicalifaceimpl.cpp =2D --- 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 =3D &kernel->groupware(); + mFolderLanguage =3D 0; // default =3D 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 =3D !folder->isMessage(i); =2D - if( KMGroupware::vPartFoundAndDecoded( folder->getMsg( i ), s ) ) =2D - ilist << s; + if (folder->folderType() =3D=3D KMFolderTypeImap) { + KMFolderImap *imap =3D static_cast(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 =2D -static QMap folderNames[2]; +static QMap folderNames[3]; QString KMailICalIfaceImpl::folderName( KFolderTreeItem::Type type, int la= nguage ) const @@ -289,2 +298,9 @@ folderNames[1][KFolderTreeItem::Notes] =3D QString::fromLatin1("Notize= n"); + + // French (TODO: Journals) + folderNames[2][KFolderTreeItem::Calendar] =3D QString::fromLatin1("Cal= endrier"); + folderNames[2][KFolderTreeItem::Tasks] =3D QString::fromLatin1("T=E2ch= es"); + folderNames[2][KFolderTreeItem::Journals] =3D QString::fromLatin1("Jou= rnal"); + folderNames[2][KFolderTreeItem::Contacts] =3D QString::fromLatin1("Con= tacts"); + folderNames[2][KFolderTreeItem::Notes] =3D QString::fromLatin1("Notes"= ); } @@ -347,3 +363,3 @@ unsigned int folderLanguage =3D options.readNumEntry( "Folder Language",= 0 ); =2D - if( folderLanguage > 1 ) folderLanguage =3D 0; + if( folderLanguage > 2 ) folderLanguage =3D 0; QString parentName =3D 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. =2D --=20 Bo Thorsen | Praestevejen 4 Senior Software Engineer | 5290 Marslev Klar=E4lvdalens Datakonsult | Denmark =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iD8DBQE/AsZ9mT99lwfUS5IRAnovAKCIxn5UF2TSPbHE0OImJSGc/S0JUwCbBXBD bOV/VbKCrITo+DfAwRae47I=3D =3DpC+P =2D----END PGP SIGNATURE----- --Boundary-00=_9ZsA/qGu2ap59R3 Content-Type: text/x-diff; charset="iso-8859-1"; name="kmgroupware.cpp-patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kmgroupware.cpp-patch" 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() && --Boundary-00=_9ZsA/qGu2ap59R3 Content-Type: text/x-diff; charset="iso-8859-1"; name="kmailicalifaceimpl.cpp-patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="kmailicalifaceimpl.cpp-patch" Index: kmailicalifaceimpl.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/taiebma/kde/cvsroot/kdepim/kmail/kmailicalifaceimpl.cpp,v retrieving revision 1.12 diff -U1 -r1.12 kmailicalifaceimpl.cpp =2D-- 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 =3D &kernel->groupware(); + mFolderLanguage =3D 0; // default =3D english connect( gw, SIGNAL( signalRefresh( const QString& ) ), @@ -120,4 +122,11 @@ bool unget =3D !folder->isMessage(i); =2D if( KMGroupware::vPartFoundAndDecoded( folder->getMsg( i ), s ) ) =2D ilist << s; + if (folder->folderType() =3D=3D KMFolderTypeImap) { + KMFolderImap *imap =3D static_cast(folder); + if( KMGroupware::vPartFoundAndDecoded( imap->getMsg( i ), s ) ) + ilist << s; + } + else { =20 + if( KMGroupware::vPartFoundAndDecoded( folder->getMsg( i ), s ) ) + ilist << s; + } if( unget ) folder->unGetMsg(i); @@ -258,3 +267,3 @@ // For now: 0->English, 1->German =2Dstatic QMap folderNames[2]; +static QMap folderNames[3]; QString KMailICalIfaceImpl::folderName( KFolderTreeItem::Type type, int la= nguage ) const @@ -289,2 +298,9 @@ folderNames[1][KFolderTreeItem::Notes] =3D QString::fromLatin1("Notize= n"); + + // French (TODO: Journals) + folderNames[2][KFolderTreeItem::Calendar] =3D QString::fromLatin1("Cal= endrier"); + folderNames[2][KFolderTreeItem::Tasks] =3D QString::fromLatin1("T=E2ch= es"); + folderNames[2][KFolderTreeItem::Journals] =3D QString::fromLatin1("Jou= rnal"); + folderNames[2][KFolderTreeItem::Contacts] =3D QString::fromLatin1("Con= tacts"); + folderNames[2][KFolderTreeItem::Notes] =3D QString::fromLatin1("Notes"= ); } @@ -347,3 +363,3 @@ unsigned int folderLanguage =3D options.readNumEntry( "Folder Language",= 0 ); =2D if( folderLanguage > 1 ) folderLanguage =3D 0; + if( folderLanguage > 2 ) folderLanguage =3D 0; QString parentName =3D options.readEntry("Folder Parent"); --Boundary-00=_9ZsA/qGu2ap59R3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KMail Developers mailing list kmail@mail.kde.org http://mail.kde.org/mailman/listinfo/kmail --Boundary-00=_9ZsA/qGu2ap59R3--