Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 2aa946d9 authored by Laurent Montel's avatar Laurent Montel 😁

Port to new connect api

parent bcfccdc7
......@@ -197,10 +197,10 @@ void KLdapTest::testLdapSearch()
LdapUrl url;
url.setUrl(m_url);
url.parseQuery();
connect(m_search, SIGNAL(result(KLDAP::LdapSearch*)),
this, SLOT(searchResult(KLDAP::LdapSearch*)));
connect(m_search, SIGNAL(data(KLDAP::LdapSearch*,KLDAP::LdapObject)),
this, SLOT(searchData(KLDAP::LdapSearch*,KLDAP::LdapObject)));
connect(m_search, &LdapSearch::result,
this, &KLdapTest::searchResult);
connect(m_search, &LdapSearch::data,
this, &KLdapTest::searchData);
bool success = m_search->search(url);
while (QCoreApplication::hasPendingEvents()) {
qApp->processEvents();
......
......@@ -47,11 +47,9 @@ private Q_SLOTS:
void testLdapDN();
void testLdapModel();
public Q_SLOTS:
private:
void searchResult(KLDAP::LdapSearch *search);
void searchData(KLDAP::LdapSearch *search, const KLDAP::LdapObject &obj);
private:
QString m_url;
LdapSearch *m_search = nullptr;
LdapObjects m_objects;
......
......@@ -348,10 +348,8 @@ void LdapConfigWidget::Private::sendQuery()
qCDebug(LDAP_LOG) << "sendQuery url:" << _url.toDisplayString();
LdapSearch search;
connect(&search, SIGNAL(data(KLDAP::LdapSearch*,KLDAP::LdapObject)),
mParent, SLOT(loadData(KLDAP::LdapSearch*,KLDAP::LdapObject)));
connect(&search, SIGNAL(result(KLDAP::LdapSearch*)),
mParent, SLOT(loadResult(KLDAP::LdapSearch*)));
connect(&search, &LdapSearch::data, mParent, [this](KLDAP::LdapSearch *s, const KLDAP::LdapObject &obj) {loadData(s, obj); });
connect(&search, &LdapSearch::result, mParent, [this](KLDAP::LdapSearch*s) { loadResult(s); });
if (!search.search(_url)) {
KMessageBox::error(mParent, search.errorString(), i18n("Check server"));
......
......@@ -273,9 +273,6 @@ Q_SIGNALS:
private:
class Private;
Private *const d;
Q_PRIVATE_SLOT(d, void loadData(KLDAP::LdapSearch *, const KLDAP::LdapObject &))
Q_PRIVATE_SLOT(d, void loadResult(KLDAP::LdapSearch *))
};
Q_DECLARE_OPERATORS_FOR_FLAGS(LdapConfigWidget::WinFlags)
......
......@@ -208,9 +208,6 @@ Q_SIGNALS:
private:
class LdapModelPrivate;
LdapModelPrivate *const m_d;
Q_PRIVATE_SLOT(m_d, void gotSearchResult(KLDAP::LdapSearch *))
Q_PRIVATE_SLOT(m_d, void gotSearchData(KLDAP::LdapSearch *, const KLDAP::LdapObject &))
};
}
......
......@@ -86,10 +86,8 @@ void LdapModel::LdapModelPrivate::recreateRootItem()
void LdapModel::LdapModelPrivate::createConnections()
{
connect(search(), SIGNAL(result(KLDAP::LdapSearch*)),
m_parent, SLOT(gotSearchResult(KLDAP::LdapSearch*)));
connect(search(), SIGNAL(data(KLDAP::LdapSearch*,KLDAP::LdapObject)),
m_parent, SLOT(gotSearchData(KLDAP::LdapSearch*,KLDAP::LdapObject)));
connect(search(), &LdapSearch::data, m_parent, [this](KLDAP::LdapSearch *s, const KLDAP::LdapObject &obj) {gotSearchData(s, obj); });
connect(search(), &LdapSearch::result, m_parent, [this](KLDAP::LdapSearch *s) { gotSearchResult(s); });
}
void LdapModel::LdapModelPrivate::populateRootToBaseDN()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment