diff --git a/src/abstractbookmarkmodel.cpp b/src/abstractbookmarkmodel.cpp index 2c951fcd6d7b1267c39a16e9419f5b3beb7c5e35..7122b06643b23b40b49fcc48989215b53e2a48e0 100644 --- a/src/abstractbookmarkmodel.cpp +++ b/src/abstractbookmarkmodel.cpp @@ -281,7 +281,7 @@ QVariant AbstractBookmarkModel::commonCallInfo(NumberTreeBackend* number, int ro switch (role) { case Qt::DisplayRole: case Call::Role::Name: - cat = number->m_pNumber->primaryName(); + cat = number->m_pNumber->contact()?number->m_pNumber->contact()->formattedName():number->m_pNumber->primaryName(); break; case Qt::ToolTipRole: cat = number->m_pNumber->presenceMessage(); @@ -398,16 +398,24 @@ bool AbstractBookmarkModel::removeRows( int row, int count, const QModelIndex & } void AbstractBookmarkModel::remove(const QModelIndex& idx) +{ + PhoneNumber* nb = getNumber(idx); + if (nb) { + removeRows(idx.row(),1,idx.parent()); + removeBookmark(nb); + emit layoutAboutToBeChanged(); + emit layoutChanged(); + } +} + +PhoneNumber* AbstractBookmarkModel::getNumber(const QModelIndex& idx) { if (idx.isValid()) { if (idx.parent().isValid() && idx.parent().row() < m_lCategoryCounter.size()) { - PhoneNumber* nb = m_lCategoryCounter[idx.parent().row()]->m_lChildren[idx.row()]->m_pNumber; - removeRows(idx.row(),1,idx.parent()); - removeBookmark(nb); - emit layoutAboutToBeChanged(); - emit layoutChanged(); + return m_lCategoryCounter[idx.parent().row()]->m_lChildren[idx.row()]->m_pNumber; } } + return nullptr; } ///Callback when an item change diff --git a/src/abstractbookmarkmodel.h b/src/abstractbookmarkmodel.h index f6d736001f4ed45a64d01e9fdbad5abc6c62e7c0..a10f4f743ba04c02b601b269cda14d9720f602de 100644 --- a/src/abstractbookmarkmodel.h +++ b/src/abstractbookmarkmodel.h @@ -65,7 +65,8 @@ public: virtual void removeBookmark(PhoneNumber* number ) = 0; //Getters - int acceptedPayloadTypes(); + int acceptedPayloadTypes(); + PhoneNumber* getNumber(const QModelIndex& idx); protected: virtual bool displayFrequentlyUsed() const; diff --git a/src/account.h b/src/account.h index e33cba982c6804b0c6d09b7725c3fc33769fcbd1..914e4eb3de11a0263fcd3528a67176b6ea3c27ab 100644 --- a/src/account.h +++ b/src/account.h @@ -31,7 +31,6 @@ class QString; #include "tlsmethodmodel.h" #include "sflphone_const.h" #include "typedefs.h" -// #include "dbus/metatypes.h" class CredentialModel; class AudioCodecModel; class VideoCodecModel; @@ -40,8 +39,6 @@ class PhoneNumber ; class SecurityValidationModel; class Certificate ; -const QString& account_state_name(const QString& s); - typedef void (Account::*account_function)(); ///@enum DtmfType Different method to send the DTMF (key sound) to the peer diff --git a/src/callmodel.cpp b/src/callmodel.cpp index 3d701f3cd12499a08dff7c261bcdf6e2ae8d6287..244770e8248df4939b03426cb527676b5073cd0c 100644 --- a/src/callmodel.cpp +++ b/src/callmodel.cpp @@ -379,10 +379,10 @@ void CallModel::removeCall(Call* call, bool noEmit) //NOTE Do not free the memory, it can still be used elsewhere or in modelindexes } - //TODO DEAD CODE Is this really required? - /*if (m_sPrivateCallList_callId[m_sPrivateCallList_callId.key(internal)] == internal) { + //TODO DEAD CODE Is this really required?, so far multi conference fail without + if (m_sPrivateCallList_callId[m_sPrivateCallList_callId.key(internal)] == internal) { m_sPrivateCallList_callId.remove(m_sPrivateCallList_callId.key(internal)); - }*/ + } removeInternal(internal);