Summary: | [PATCH] LDAP updates done externally are not reflected in kontact until restart or re-selecting resource | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | BJ Blanchard <blabj> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
BJ Blanchard
2006-10-19 17:16:47 UTC
The following patch forces a re-load of any active LDAP resources everytime there is a check for new mail. It may not be the most elegant of solutions but it works! BJ. --- accountmanager.cpp 2006-10-23 10:57:50.000000000 -0400 +++ /usr/portage/distfiles/kdepim-3.5.5/kmail/accountmanager.cpp 2006-10-24 11:11:22.000000000 -0400 @@ -26,6 +26,18 @@ #include <qregexp.h> #include <qvaluelist.h> +// Include files for LDAP re-load +#include <qptrlist.h> +#include <kresources/resource.h> + +#include <kabc/addressbook.h> +#include <kabc/stdaddressbook.h> +#include <kabc/resource.h> +#include "ldapclient.h" + +#include "kabc/resourceldapkio.h" +// + using namespace KMail; //----------------------------------------------------------------------------- @@ -312,6 +324,25 @@ if ( !(*it)->checkExclude() ) singleCheckMail( (*it), _interactive); } + + KABC::AddressBook* myAB = KABC::StdAddressBook::self(false); + + QPtrList<KABC::Resource> kabcResources = myAB->resources(); + QPtrListIterator<KABC::Resource> kabcResourceIterator( kabcResources ); + + KABC::Resource* i; + + while( (i = kabcResourceIterator.current() ) != 0) + { + ++kabcResourceIterator; + KRES::Resource* res = static_cast<KRES::Resource*>( i ); + if(res && res->type() == "ldapkio") { + if (res->isActive()) { + i->load(); + } + } + } + } Thank you for taking the time to file a bug report. KMail2 was released in 2011, and the entire code base went through significant changes. We are currently in the process of porting to Qt5 and KF5. It is unlikely that these bugs are still valid in KMail2. We welcome you to try out KMail 2 with the KDE 4.14 release and give your feedback. |