Fix missing phone labels.
Fix transferring menu with same items (same address and phone number). Fix build compilation. Add a QList operator for QML. Fix typo.
This commit is contained in:
parent
1be5ae2bad
commit
2494600efe
6 changed files with 23 additions and 6 deletions
|
|
@ -114,7 +114,7 @@ endif ()
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Prepare gobal CMAKE configuration specific to the current project
|
# Prepare gobal CMAKE configuration specific to the current project
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)#Needed for Qt
|
||||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/OUTPUT" CACHE PATH "Default linphone-app installation prefix" FORCE)
|
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/OUTPUT" CACHE PATH "Default linphone-app installation prefix" FORCE)
|
||||||
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE)
|
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE)
|
||||||
|
|
|
||||||
|
|
@ -69,9 +69,10 @@ FriendCore::FriendCore(const std::shared_ptr<linphone::Friend> &contact, bool is
|
||||||
// lDebug() << mDefaultAddress << " / " << mDefaultFullAddress;
|
// lDebug() << mDefaultAddress << " / " << mDefaultFullAddress;
|
||||||
auto phoneNumbers = contact->getPhoneNumbersWithLabel();
|
auto phoneNumbers = contact->getPhoneNumbersWithLabel();
|
||||||
for (auto &phoneNumber : phoneNumbers) {
|
for (auto &phoneNumber : phoneNumbers) {
|
||||||
|
auto label = Utils::coreStringToAppString(phoneNumber->getLabel());
|
||||||
|
if (label.isEmpty()) label = _phoneLabel;
|
||||||
mPhoneNumberList.append(
|
mPhoneNumberList.append(
|
||||||
Utils::createFriendAddressVariant(Utils::coreStringToAppString(phoneNumber->getLabel()),
|
Utils::createFriendAddressVariant(label, Utils::coreStringToAppString(phoneNumber->getPhoneNumber())));
|
||||||
Utils::coreStringToAppString(phoneNumber->getPhoneNumber())));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto devices = contact->getDevices();
|
auto devices = contact->getDevices();
|
||||||
|
|
@ -429,8 +430,19 @@ void FriendCore::resetAddresses(QList<QVariant> newList) {
|
||||||
emit addressChanged();
|
emit addressChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Display all sip addresses and remove phone numbers duplicates (priority on sip)
|
||||||
QList<QVariant> FriendCore::getAllAddresses() const {
|
QList<QVariant> FriendCore::getAllAddresses() const {
|
||||||
return mAddressList + mPhoneNumberList;
|
QList<QVariant> addresses;
|
||||||
|
auto addressIt = mAddressList.begin();
|
||||||
|
auto phoneNumbers = mPhoneNumberList;
|
||||||
|
while (addressIt != mAddressList.end()) {
|
||||||
|
auto username = Utils::getUsername(addressIt->toMap()["address"].toString());
|
||||||
|
std::remove_if(phoneNumbers.begin(), phoneNumbers.end(),
|
||||||
|
[username](const QVariant &data) { return data.toMap()["address"].toString() == username; });
|
||||||
|
++addressIt;
|
||||||
|
}
|
||||||
|
addresses << phoneNumbers;
|
||||||
|
return addresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QVariant> FriendCore::getDevices() const {
|
QList<QVariant> FriendCore::getDevices() const {
|
||||||
|
|
|
||||||
|
|
@ -1412,6 +1412,10 @@ QString Utils::getFileChecksum(const QString &filePath) {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<QVariant> Utils::append(const QList<QVariant> a, const QList<QVariant> b) {
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
|
||||||
// Codecs download
|
// Codecs download
|
||||||
|
|
||||||
QList<QSharedPointer<DownloadablePayloadTypeCore>> Utils::getDownloadableVideoPayloadTypes() {
|
QList<QSharedPointer<DownloadablePayloadTypeCore>> Utils::getDownloadableVideoPayloadTypes() {
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ public:
|
||||||
Q_INVOKABLE bool isInteger(const QString &text);
|
Q_INVOKABLE bool isInteger(const QString &text);
|
||||||
Q_INVOKABLE QString boldTextPart(const QString &text, const QString ®ex);
|
Q_INVOKABLE QString boldTextPart(const QString &text, const QString ®ex);
|
||||||
Q_INVOKABLE static QString getFileChecksum(const QString &filePath);
|
Q_INVOKABLE static QString getFileChecksum(const QString &filePath);
|
||||||
|
Q_INVOKABLE QList<QVariant> append(const QList<QVariant> a, const QList<QVariant> b);
|
||||||
|
|
||||||
static QString getApplicationProduct();
|
static QString getApplicationProduct();
|
||||||
static QString getOsProduct();
|
static QString getOsProduct();
|
||||||
|
|
|
||||||
|
|
@ -441,7 +441,7 @@ AbstractMainPage {
|
||||||
clip: true
|
clip: true
|
||||||
spacing: 9 * DefaultStyle.dp
|
spacing: 9 * DefaultStyle.dp
|
||||||
model: VariantList {
|
model: VariantList {
|
||||||
model: mainItem.selectedContact ? mainItem.selectedContact.core.allAddresses : []
|
model: (mainItem.selectedContact ? UtilsCpp.append(mainItem.selectedContact.core.addresses, mainItem.selectedContact.core.phoneNumbers): [])
|
||||||
}
|
}
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
property var listViewModelData: modelData
|
property var listViewModelData: modelData
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ ApplicationWindow {
|
||||||
spacing: 5 * DefaultStyle.dp
|
spacing: 5 * DefaultStyle.dp
|
||||||
width: startCallPopup.width
|
width: startCallPopup.width
|
||||||
Text {
|
Text {
|
||||||
text: qsTr("Quelle addresse souhaitez-vous appeler ?")
|
text: qsTr("Quelle adresse souhaitez-vous appeler ?")
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
font {
|
font {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue