Fix onlyDisplaySipUriUsername where domain was still shown.
This commit is contained in:
parent
940227dc92
commit
f68327bcf6
6 changed files with 16 additions and 5 deletions
|
|
@ -232,6 +232,7 @@ void FriendCore::reset(const FriendCore &contact) {
|
||||||
resetAddresses(contact.getAddresses());
|
resetAddresses(contact.getAddresses());
|
||||||
resetPhoneNumbers(contact.getPhoneNumbers());
|
resetPhoneNumbers(contact.getPhoneNumbers());
|
||||||
setDefaultAddress(contact.getDefaultAddress());
|
setDefaultAddress(contact.getDefaultAddress());
|
||||||
|
setDisplayName(contact.getDisplayName());
|
||||||
setGivenName(contact.getGivenName());
|
setGivenName(contact.getGivenName());
|
||||||
setFamilyName(contact.getFamilyName());
|
setFamilyName(contact.getFamilyName());
|
||||||
setOrganization(contact.getOrganization());
|
setOrganization(contact.getOrganization());
|
||||||
|
|
@ -244,6 +245,14 @@ QString FriendCore::getDisplayName() const {
|
||||||
return !mFullName.isEmpty() ? mFullName : mGivenName + " " + mFamilyName;
|
return !mFullName.isEmpty() ? mFullName : mGivenName + " " + mFamilyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FriendCore::setDisplayName(const QString &name) {
|
||||||
|
if (mFullName != name) {
|
||||||
|
mFullName = name;
|
||||||
|
emit displayNameChanged();
|
||||||
|
setIsSaved(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QString FriendCore::getGivenName() const {
|
QString FriendCore::getGivenName() const {
|
||||||
return mGivenName;
|
return mGivenName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ class FriendCore : public QObject, public AbstractObject {
|
||||||
Q_PROPERTY(int verifiedDeviceCount MEMBER mVerifiedDeviceCount NOTIFY verifiedDevicesChanged)
|
Q_PROPERTY(int verifiedDeviceCount MEMBER mVerifiedDeviceCount NOTIFY verifiedDevicesChanged)
|
||||||
Q_PROPERTY(QString givenName READ getGivenName WRITE setGivenName NOTIFY givenNameChanged)
|
Q_PROPERTY(QString givenName READ getGivenName WRITE setGivenName NOTIFY givenNameChanged)
|
||||||
Q_PROPERTY(QString familyName READ getFamilyName WRITE setFamilyName NOTIFY familyNameChanged)
|
Q_PROPERTY(QString familyName READ getFamilyName WRITE setFamilyName NOTIFY familyNameChanged)
|
||||||
Q_PROPERTY(QString displayName READ getDisplayName NOTIFY displayNameChanged)
|
Q_PROPERTY(QString displayName READ getDisplayName WRITE setDisplayName NOTIFY displayNameChanged)
|
||||||
Q_PROPERTY(QString organization READ getOrganization WRITE setOrganization NOTIFY organizationChanged)
|
Q_PROPERTY(QString organization READ getOrganization WRITE setOrganization NOTIFY organizationChanged)
|
||||||
Q_PROPERTY(QString job READ getJob WRITE setJob NOTIFY jobChanged)
|
Q_PROPERTY(QString job READ getJob WRITE setJob NOTIFY jobChanged)
|
||||||
Q_PROPERTY(QString defaultAddress READ getDefaultAddress WRITE setDefaultAddress NOTIFY defaultAddressChanged)
|
Q_PROPERTY(QString defaultAddress READ getDefaultAddress WRITE setDefaultAddress NOTIFY defaultAddressChanged)
|
||||||
|
|
@ -81,6 +81,7 @@ public:
|
||||||
void reset(const FriendCore &contact);
|
void reset(const FriendCore &contact);
|
||||||
|
|
||||||
QString getDisplayName() const;
|
QString getDisplayName() const;
|
||||||
|
void setDisplayName(const QString &name);
|
||||||
|
|
||||||
QString getFamilyName() const;
|
QString getFamilyName() const;
|
||||||
void setFamilyName(const QString &name);
|
void setFamilyName(const QString &name);
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,8 @@ void MagicSearchList::setSelf(QSharedPointer<MagicSearchList> me) {
|
||||||
} else if (auto address = it->getAddress()) {
|
} else if (auto address = it->getAddress()) {
|
||||||
auto linphoneFriend = CoreModel::getInstance()->getCore()->createFriend();
|
auto linphoneFriend = CoreModel::getInstance()->getCore()->createFriend();
|
||||||
contact = FriendCore::create(linphoneFriend);
|
contact = FriendCore::create(linphoneFriend);
|
||||||
contact->setGivenName(Utils::coreStringToAppString(address->asStringUriOnly()));
|
contact->setDisplayName(Utils::coreStringToAppString(address->getDisplayName()));
|
||||||
|
contact->setGivenName(Utils::coreStringToAppString(address->getUsername()));
|
||||||
contact->appendAddress(Utils::coreStringToAppString(address->asStringUriOnly()));
|
contact->appendAddress(Utils::coreStringToAppString(address->asStringUriOnly()));
|
||||||
contacts->append(contact);
|
contacts->append(contact);
|
||||||
} else if (!it->getPhoneNumber().empty()) {
|
} else if (!it->getPhoneNumber().empty()) {
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
visible: mainItem.specificAddress != ""
|
visible: mainItem.specificAddress != ""
|
||||||
text: mainItem.specificAddress
|
text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(mainItem.specificAddress) : mainItem.specificAddress
|
||||||
elide: Text.ElideMiddle
|
elide: Text.ElideMiddle
|
||||||
maximumLineCount: 1
|
maximumLineCount: 1
|
||||||
font {
|
font {
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ ListView {
|
||||||
Text {
|
Text {
|
||||||
Layout.topMargin: 2 * DefaultStyle.dp
|
Layout.topMargin: 2 * DefaultStyle.dp
|
||||||
visible: mainItem.showDefaultAddress
|
visible: mainItem.showDefaultAddress
|
||||||
text: modelData.core.defaultAddress
|
text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(modelData.core.defaultAddress) : modelData.core.defaultAddress
|
||||||
font {
|
font {
|
||||||
weight: 300 * DefaultStyle.dp
|
weight: 300 * DefaultStyle.dp
|
||||||
pixelSize: 12 * DefaultStyle.dp
|
pixelSize: 12 * DefaultStyle.dp
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,7 @@ Item {
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
property var urlObj: UtilsCpp.interpretUrl(magicSearchBar.text)
|
property var urlObj: UtilsCpp.interpretUrl(magicSearchBar.text)
|
||||||
text: urlObj?.value
|
text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(urlObj?.value) : urlObj?.value
|
||||||
font {
|
font {
|
||||||
pixelSize: 12 * DefaultStyle.dp
|
pixelSize: 12 * DefaultStyle.dp
|
||||||
weight: 300 * DefaultStyle.dp
|
weight: 300 * DefaultStyle.dp
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue