diff options
author | Timothy Pearson <[email protected]> | 2012-12-12 00:43:05 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-12-12 00:43:05 -0600 |
commit | 9b5b85669027e3691b6bc335800aa8c21716024f (patch) | |
tree | 12ad1b67f156ddd5aeb4e353ce143bad1cfb8ec9 /src/ldapmgr.cpp | |
parent | 431b794730a8c27f05ae9d1ee7519adc1dd6c2d4 (diff) | |
download | kcmldapmanager-9b5b85669027e3691b6bc335800aa8c21716024f.tar.gz kcmldapmanager-9b5b85669027e3691b6bc335800aa8c21716024f.zip |
Fix invalid DN error on startup when default realm is not set
Diffstat (limited to 'src/ldapmgr.cpp')
-rw-r--r-- | src/ldapmgr.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ldapmgr.cpp b/src/ldapmgr.cpp index d152ebe..28ae1ac 100644 --- a/src/ldapmgr.cpp +++ b/src/ldapmgr.cpp @@ -168,7 +168,21 @@ void LDAPConfig::load() { } } } - connectToRealm(base->user_ldapRealm->currentText().upper()); + else { + // Try hard not to select the "<none>" realm + for (i=0; i<base->user_ldapRealm->count(); i++) { + if (base->user_ldapRealm->text(i).lower() != "<none>") { + base->user_ldapRealm->setCurrentItem(i); + base->group_ldapRealm->setCurrentItem(i); + base->machine_ldapRealm->setCurrentItem(i); + base->service_ldapRealm->setCurrentItem(i); + break; + } + } + } + if (base->user_ldapRealm->currentText().lower() != "<none>") { + connectToRealm(base->user_ldapRealm->currentText().upper()); + } } void LDAPConfig::defaults() { |