Fix Ldap & Carddav adding

This commit is contained in:
Christophe Deschamps 2024-11-15 09:03:50 +01:00
parent 351199d163
commit 69f6683a47
6 changed files with 24 additions and 3 deletions

View file

@ -29,6 +29,14 @@ CarddavGui::CarddavGui(QSharedPointer<CarddavCore> core) {
if (isInLinphoneThread()) moveToThread(App::getInstance()->thread());
}
CarddavGui::CarddavGui(QObject *parent) : QObject(parent) {
mustBeInMainThread(log().arg(Q_FUNC_INFO));
App::postModelSync([this]() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mCore = CarddavCore::create(nullptr);
});
}
CarddavGui::~CarddavGui() {
mustBeInMainThread("~" + getClassName());
}

View file

@ -32,6 +32,7 @@ class CarddavGui : public QObject, public AbstractObject {
public:
CarddavGui(QSharedPointer<CarddavCore> core);
CarddavGui(QObject *parent = nullptr);
~CarddavGui();
CarddavCore *getCore() const;
QSharedPointer<CarddavCore> mCore;

View file

@ -72,12 +72,14 @@ void CarddavList::setSelf(QSharedPointer<CarddavList> me) {
});
});
});
QObject::connect(
CoreModel::getInstance().get(), &CoreModel::friendListRemoved, this,
mModelConnection->makeConnectToModel(
&CoreModel::friendListRemoved,
[this](const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::FriendList> &friendList) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
emit lUpdate();
});
emit lUpdate();
}

View file

@ -29,6 +29,14 @@ LdapGui::LdapGui(QSharedPointer<LdapCore> core) {
if (isInLinphoneThread()) moveToThread(App::getInstance()->thread());
}
LdapGui::LdapGui(QObject *parent) : QObject(parent) {
mustBeInMainThread(getClassName());
App::postModelSync([this]() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mCore = LdapCore::create(nullptr);
});
}
LdapGui::~LdapGui() {
mustBeInMainThread("~" + getClassName());
}

View file

@ -32,6 +32,7 @@ class LdapGui : public QObject, public AbstractObject {
public:
LdapGui(QSharedPointer<LdapCore> core);
LdapGui(QObject *parent = nullptr);
~LdapGui();
LdapCore *getCore() const;
QSharedPointer<LdapCore> mCore;

View file

@ -76,7 +76,8 @@ RowLayout {
}
}
onVisibleChanged: {
proxyModel.updateView()
if (visible)
proxyModel.updateView()
}
Component.onCompleted: {
proxyModel.updateView()