KLdap

ldapwidgetitemreadconfigserverjob.cpp
1/*
2 * SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#include "ldapwidgetitemreadconfigserverjob.h"
8#include "ldapclientsearchconfigreadconfigjob.h"
9#include "ldapwidgetitem_p.h"
10using namespace KLDAPWidgets;
11LdapWidgetItemReadConfigServerJob::LdapWidgetItemReadConfigServerJob(QObject *parent)
12 : QObject(parent)
13{
14}
15
16LdapWidgetItemReadConfigServerJob::~LdapWidgetItemReadConfigServerJob() = default;
17
18void LdapWidgetItemReadConfigServerJob::start()
19{
20 auto job = new KLDAPCore::LdapClientSearchConfigReadConfigJob(this);
21 connect(job, &KLDAPCore::LdapClientSearchConfigReadConfigJob::configLoaded, this, &LdapWidgetItemReadConfigServerJob::slotConfigLoaded);
22 job->setActive(mActive);
23 job->setConfig(mConfig);
24 job->setServerIndex(mCurrentIndex);
25 job->start();
26}
27
28void LdapWidgetItemReadConfigServerJob::slotConfigLoaded(const KLDAPCore::LdapServer &server)
29{
30 mLdapWidgetItem->setServer(server);
32}
33
34LdapWidgetItem *LdapWidgetItemReadConfigServerJob::ldapWidgetItem() const
35{
36 return mLdapWidgetItem;
37}
38
39void LdapWidgetItemReadConfigServerJob::setLdapWidgetItem(LdapWidgetItem *ldapWidgetItem)
40{
41 mLdapWidgetItem = ldapWidgetItem;
42}
43
44int LdapWidgetItemReadConfigServerJob::currentIndex() const
45{
46 return mCurrentIndex;
47}
48
49void LdapWidgetItemReadConfigServerJob::setCurrentIndex(int currentIndex)
50{
51 mCurrentIndex = currentIndex;
52}
53
54bool LdapWidgetItemReadConfigServerJob::active() const
55{
56 return mActive;
57}
58
59void LdapWidgetItemReadConfigServerJob::setActive(bool active)
60{
61 mActive = active;
62}
63
64KConfigGroup LdapWidgetItemReadConfigServerJob::config() const
65{
66 return mConfig;
67}
68
69void LdapWidgetItemReadConfigServerJob::setConfig(const KConfigGroup &config)
70{
71 mConfig = config;
72}
73
74#include "moc_ldapwidgetitemreadconfigserverjob.cpp"
A class that contains LDAP server connection settings.
Definition ldapserver.h:27
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:34:09 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.