mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Ldap debug option
This commit is contained in:
parent
ab4acc8f03
commit
40137bcf26
5 changed files with 24 additions and 8 deletions
|
|
@ -51,7 +51,7 @@ LdapCore::LdapCore(const std::shared_ptr<linphone::Ldap> &ldap) : QObject(nullpt
|
|||
INIT_CORE_MEMBER(NameAttribute, mLdapModel)
|
||||
INIT_CORE_MEMBER(SipAttribute, mLdapModel)
|
||||
INIT_CORE_MEMBER(SipDomain, mLdapModel)
|
||||
INIT_CORE_MEMBER(DebugLevel, mLdapModel)
|
||||
INIT_CORE_MEMBER(Debug, mLdapModel)
|
||||
}
|
||||
|
||||
LdapCore::~LdapCore() {
|
||||
|
|
@ -101,13 +101,12 @@ void LdapCore::setSelf(QSharedPointer<LdapCore> me) {
|
|||
DEFINE_CORE_GETSET_CONNECT(mLdapModelConnection, LdapCore, LdapModel, mLdapModel, QString, sipAttribute,
|
||||
SipAttribute)
|
||||
DEFINE_CORE_GETSET_CONNECT(mLdapModelConnection, LdapCore, LdapModel, mLdapModel, QString, sipDomain, SipDomain)
|
||||
DEFINE_CORE_GETSET_CONNECT(mLdapModelConnection, LdapCore, LdapModel, mLdapModel, linphone::Ldap::DebugLevel,
|
||||
debugLevel, DebugLevel)
|
||||
DEFINE_CORE_GETSET_CONNECT(mLdapModelConnection, LdapCore, LdapModel, mLdapModel, bool, debug, Debug)
|
||||
|
||||
mLdapModelConnection->makeConnectToModel(&LdapModel::saved, [this]() {
|
||||
mLdapModelConnection->invokeToCore([this]() { emit App::getInstance()->getSettings()->ldapConfigChanged(); });
|
||||
mLdapModelConnection->invokeToCore([this]() { emit App::getInstance() -> getSettings()->ldapConfigChanged(); });
|
||||
});
|
||||
mLdapModelConnection->makeConnectToModel(&LdapModel::removed, [this]() {
|
||||
mLdapModelConnection->invokeToCore([this]() { emit App::getInstance()->getSettings()->ldapConfigChanged(); });
|
||||
mLdapModelConnection->invokeToCore([this]() { emit App::getInstance() -> getSettings()->ldapConfigChanged(); });
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public:
|
|||
DECLARE_CORE_GETSET_MEMBER(QString, nameAttribute, NameAttribute)
|
||||
DECLARE_CORE_GETSET_MEMBER(QString, sipAttribute, SipAttribute)
|
||||
DECLARE_CORE_GETSET_MEMBER(QString, sipDomain, SipDomain)
|
||||
DECLARE_CORE_GETSET_MEMBER(linphone::Ldap::DebugLevel, debugLevel, DebugLevel)
|
||||
DECLARE_CORE_GETSET_MEMBER(bool, debug, Debug)
|
||||
|
||||
private:
|
||||
std::shared_ptr<LdapModel> mLdapModel;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,19 @@ void LdapModel::remove() {
|
|||
emit removed();
|
||||
}
|
||||
|
||||
bool LdapModel::getDebug() const {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
return mLdapParamsClone->getDebugLevel() == linphone::Ldap::DebugLevel::Verbose;
|
||||
}
|
||||
void LdapModel::setDebug(bool data) {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
if (getDebug() != data) {
|
||||
mLdapParamsClone->setDebugLevel(data ? linphone::Ldap::DebugLevel::Verbose : linphone::Ldap::DebugLevel::Off);
|
||||
save();
|
||||
emit debugChanged(data);
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_GETSET(LdapModel, bool, enabled, Enabled, mLdapParamsClone)
|
||||
DEFINE_GETSET_MODEL_STRING(LdapModel, server, Server, mLdapParamsClone)
|
||||
DEFINE_GETSET_MODEL_STRING(LdapModel, bindDn, BindDn, mLdapParamsClone)
|
||||
|
|
@ -83,4 +96,3 @@ DEFINE_GETSET(LdapModel, int, minChars, MinChars, mLdapParamsClone)
|
|||
DEFINE_GETSET_MODEL_STRING(LdapModel, nameAttribute, NameAttribute, mLdapParamsClone)
|
||||
DEFINE_GETSET_MODEL_STRING(LdapModel, sipAttribute, SipAttribute, mLdapParamsClone)
|
||||
DEFINE_GETSET_MODEL_STRING(LdapModel, sipDomain, SipDomain, mLdapParamsClone)
|
||||
DEFINE_GETSET(LdapModel, linphone::Ldap::DebugLevel, debugLevel, DebugLevel, mLdapParamsClone)
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
DECLARE_GETSET(QString, nameAttribute, NameAttribute)
|
||||
DECLARE_GETSET(QString, sipAttribute, SipAttribute)
|
||||
DECLARE_GETSET(QString, sipDomain, SipDomain)
|
||||
DECLARE_GETSET(linphone::Ldap::DebugLevel, debugLevel, DebugLevel)
|
||||
DECLARE_GETSET(bool, debug, Debug)
|
||||
|
||||
signals:
|
||||
void saved();
|
||||
|
|
|
|||
|
|
@ -176,6 +176,11 @@ AbstractSettingsLayout {
|
|||
title: qsTr("Domaine SIP")
|
||||
toValidate: true
|
||||
}
|
||||
SwitchSetting {
|
||||
titleText: qsTr("Débogage")
|
||||
propertyName: "debug"
|
||||
propertyOwner: ldapGui.core
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue