summaryrefslogtreecommitdiffstats
path: root/libkdepim/ldapclient.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /libkdepim/ldapclient.cpp
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdepim/ldapclient.cpp')
-rw-r--r--libkdepim/ldapclient.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/libkdepim/ldapclient.cpp b/libkdepim/ldapclient.cpp
index 359e03568..39d384e83 100644
--- a/libkdepim/ldapclient.cpp
+++ b/libkdepim/ldapclient.cpp
@@ -349,6 +349,22 @@ LdapSearch::LdapSearch()
TQT_SLOT(slotFileChanged(const TQString&)));
}
+void LdapSearch::readWeighForClient( LdapClient *client, KConfig *config, int clientNumber )
+{
+ const int completionWeight = config->readNumEntry( TQString( "SelectedCompletionWeight%1" ).arg( clientNumber ), -1 );
+ if ( completionWeight != -1 )
+ client->setCompletionWeight( completionWeight );
+}
+
+void LdapSearch::updateCompletionWeights()
+{
+ KConfig *config = KPIM::LdapSearch::config();
+ config->setGroup( "LDAP" );
+ for ( uint i = 0; i < mClients.size(); i++ ) {
+ readWeighForClient( mClients[i], config, i );
+ }
+}
+
void LdapSearch::readConfig()
{
cancelSearch();
@@ -371,9 +387,7 @@ void LdapSearch::readConfig()
if ( !server.host().isEmpty() ) mNoLDAPLookup = false;
ldapClient->setServer( server );
- int completionWeight = config->readNumEntry( TQString( "SelectedCompletionWeight%1" ).arg( j ), -1 );
- if ( completionWeight != -1 )
- ldapClient->setCompletionWeight( completionWeight );
+ readWeighForClient( ldapClient, config, j );
TQStringList attrs;
// note: we need "objectClass" to detect distribution lists
@@ -499,7 +513,7 @@ void LdapSearch::makeSearchData( TQStringList& ret, LdapResultList& resList )
bool wasCN = false;
bool wasDC = false;
- kdDebug(5300) << "\n\nLdapSearch::makeSearchData()\n\n" << endl;
+ //kdDebug(5300) << "\n\nLdapSearch::makeSearchData()\n\n" << endl;
LdapAttrMap::ConstIterator it2;
for ( it2 = (*it1).attrs.begin(); it2 != (*it1).attrs.end(); ++it2 ) {
@@ -508,7 +522,7 @@ void LdapSearch::makeSearchData( TQStringList& ret, LdapResultList& resList )
if( len > 0 && '\0' == val[len-1] )
--len;
const TQString tmp = TQString::fromUtf8( val, len );
- kdDebug(5300) << " key: \"" << it2.key() << "\" value: \"" << tmp << "\"" << endl;
+ //kdDebug(5300) << " key: \"" << it2.key() << "\" value: \"" << tmp << "\"" << endl;
if ( it2.key() == "cn" ) {
name = tmp;
if( mail.isEmpty() )
@@ -551,7 +565,7 @@ void LdapSearch::makeSearchData( TQStringList& ret, LdapResultList& resList )
if( mails.isEmpty()) {
if ( !mail.isEmpty() ) mails.append( mail );
if( isDistributionList ) {
- kdDebug(5300) << "\n\nLdapSearch::makeSearchData() found a list: " << name << "\n\n" << endl;
+ //kdDebug(5300) << "\n\nLdapSearch::makeSearchData() found a list: " << name << "\n\n" << endl;
ret.append( name );
// following lines commented out for bugfixing kolab issue #177:
//
@@ -568,14 +582,14 @@ void LdapSearch::makeSearchData( TQStringList& ret, LdapResultList& resList )
//mail.prepend( name );
//mail = name;
} else {
- kdDebug(5300) << "LdapSearch::makeSearchData() found BAD ENTRY: \"" << name << "\"" << endl;
+ //kdDebug(5300) << "LdapSearch::makeSearchData() found BAD ENTRY: \"" << name << "\"" << endl;
continue; // nothing, bad entry
}
} else if ( name.isEmpty() ) {
- kdDebug(5300) << "LdapSearch::makeSearchData() mail: \"" << mail << "\"" << endl;
+ //kdDebug(5300) << "LdapSearch::makeSearchData() mail: \"" << mail << "\"" << endl;
ret.append( mail );
} else {
- kdDebug(5300) << "LdapSearch::makeSearchData() name: \"" << name << "\" mail: \"" << mail << "\"" << endl;
+ //kdDebug(5300) << "LdapSearch::makeSearchData() name: \"" << name << "\" mail: \"" << mail << "\"" << endl;
ret.append( TQString( "%1 <%2>" ).arg( name ).arg( mail ) );
}