diff --git a/linphone-desktop/src/app/App.cpp b/linphone-desktop/src/app/App.cpp index 125bd0b75..c930ce4d8 100644 --- a/linphone-desktop/src/app/App.cpp +++ b/linphone-desktop/src/app/App.cpp @@ -359,7 +359,7 @@ void App::registerTypes () { registerMetaType("ChatModel::EntryType"); registerUncreatableType(CallModel, "CallModel"); - registerUncreatableType(ConferenceAddModel, "ConferenceAddModel"); + registerUncreatableType(ConferenceHelperModel::ConferenceAddModel, "ConferenceAddModel"); registerUncreatableType(ContactModel, "ContactModel"); registerUncreatableType(SipAddressObserver, "SipAddressObserver"); registerUncreatableType(VcardModel, "VcardModel"); diff --git a/linphone-desktop/src/components/Components.hpp b/linphone-desktop/src/components/Components.hpp index 1f7189641..fb798cf88 100644 --- a/linphone-desktop/src/components/Components.hpp +++ b/linphone-desktop/src/components/Components.hpp @@ -32,7 +32,6 @@ #include "codecs/AudioCodecsModel.hpp" #include "codecs/VideoCodecsModel.hpp" #include "conference/ConferenceAddModel.hpp" -#include "conference/ConferenceHelperModel.hpp" #include "contacts/ContactsListProxyModel.hpp" #include "core/CoreManager.hpp" #include "presence/OwnPresenceModel.hpp" diff --git a/linphone-desktop/src/components/conference/ConferenceAddModel.cpp b/linphone-desktop/src/components/conference/ConferenceAddModel.cpp index 5f43f442c..85cdfba8d 100644 --- a/linphone-desktop/src/components/conference/ConferenceAddModel.cpp +++ b/linphone-desktop/src/components/conference/ConferenceAddModel.cpp @@ -22,7 +22,6 @@ #include "../../Utils.hpp" #include "../core/CoreManager.hpp" -#include "ConferenceHelperModel.hpp" #include "ConferenceAddModel.hpp" @@ -30,7 +29,7 @@ using namespace std; // ============================================================================= -ConferenceAddModel::ConferenceAddModel (QObject *parent) : QAbstractListModel(parent) { +ConferenceHelperModel::ConferenceAddModel::ConferenceAddModel (QObject *parent) : QAbstractListModel(parent) { mConferenceHelperModel = qobject_cast(parent); Q_ASSERT(mConferenceHelperModel != nullptr); @@ -38,17 +37,17 @@ ConferenceAddModel::ConferenceAddModel (QObject *parent) : QAbstractListModel(pa addToConference(participant); } -int ConferenceAddModel::rowCount (const QModelIndex &) const { +int ConferenceHelperModel::ConferenceAddModel::rowCount (const QModelIndex &) const { return mRefs.count(); } -QHash ConferenceAddModel::roleNames () const { +QHash ConferenceHelperModel::ConferenceAddModel::roleNames () const { QHash roles; roles[Qt::DisplayRole] = "$sipAddress"; return roles; } -QVariant ConferenceAddModel::data (const QModelIndex &index, int role) const { +QVariant ConferenceHelperModel::ConferenceAddModel::data (const QModelIndex &index, int role) const { int row = index.row(); if (!index.isValid() || row < 0 || row >= mRefs.count()) @@ -62,7 +61,7 @@ QVariant ConferenceAddModel::data (const QModelIndex &index, int role) const { // ----------------------------------------------------------------------------- -bool ConferenceAddModel::addToConference (const QString &sipAddress) { +bool ConferenceHelperModel::ConferenceAddModel::addToConference (const QString &sipAddress) { if (mSipAddresses.contains(sipAddress)) return false; @@ -83,7 +82,7 @@ bool ConferenceAddModel::addToConference (const QString &sipAddress) { return true; } -bool ConferenceAddModel::removeFromConference (const QString &sipAddress) { +bool ConferenceHelperModel::ConferenceAddModel::removeFromConference (const QString &sipAddress) { auto it = mSipAddresses.find(sipAddress); if (it == mSipAddresses.end()) return false; @@ -106,7 +105,7 @@ bool ConferenceAddModel::removeFromConference (const QString &sipAddress) { // ----------------------------------------------------------------------------- -void ConferenceAddModel::update () { +void ConferenceHelperModel::ConferenceAddModel::update () { list > linphoneAddresses; for (const auto &map : mRefs) linphoneAddresses.push_back(map->value("__linphoneAddress").value > ()); @@ -119,7 +118,7 @@ void ConferenceAddModel::update () { // ----------------------------------------------------------------------------- -void ConferenceAddModel::addToConference (const std::shared_ptr &linphoneAddress) { +void ConferenceHelperModel::ConferenceAddModel::addToConference (const std::shared_ptr &linphoneAddress) { QString sipAddress = ::Utils::linphoneStringToQString(linphoneAddress->asStringUriOnly()); QVariantMap map; diff --git a/linphone-desktop/src/components/conference/ConferenceAddModel.hpp b/linphone-desktop/src/components/conference/ConferenceAddModel.hpp index 8cc4c9e49..854d62ff6 100644 --- a/linphone-desktop/src/components/conference/ConferenceAddModel.hpp +++ b/linphone-desktop/src/components/conference/ConferenceAddModel.hpp @@ -25,17 +25,15 @@ #include -#include +#include "ConferenceHelperModel.hpp" // ============================================================================= -class ConferenceHelperModel; - namespace linphone { class Address; } -class ConferenceAddModel : public QAbstractListModel { +class ConferenceHelperModel::ConferenceAddModel : public QAbstractListModel { Q_OBJECT; public: diff --git a/linphone-desktop/src/components/conference/ConferenceHelperModel.hpp b/linphone-desktop/src/components/conference/ConferenceHelperModel.hpp index 00e5c73e2..2eca70ae0 100644 --- a/linphone-desktop/src/components/conference/ConferenceHelperModel.hpp +++ b/linphone-desktop/src/components/conference/ConferenceHelperModel.hpp @@ -37,13 +37,13 @@ namespace linphone { } class ConferenceHelperModel : public QSortFilterProxyModel { - friend class ConferenceAddModel; - Q_OBJECT; Q_PROPERTY(ConferenceAddModel * toAdd READ getConferenceAddModel CONSTANT); public: + class ConferenceAddModel; + ConferenceHelperModel (QObject *parent = Q_NULLPTR); ~ConferenceHelperModel () = default;